tdm_backend: change _check_abi_version() return value 69/99769/2
authorYoungJun Cho <yj44.cho@samsung.com>
Thu, 24 Nov 2016 05:20:18 +0000 (14:20 +0900)
committerYoungJun Cho <yj44.cho@samsung.com>
Thu, 24 Nov 2016 05:34:12 +0000 (21:34 -0800)
This patch changes _check_abi_version() return value
as 0 for success, -1 for failure.
The caller only checks the result is less than 0 or not, so it is dead code.

Change-Id: I194817bcd0fd928f0b66cdd0154c3669c95548f5
Signed-off-by: YoungJun Cho <yj44.cho@samsung.com>
src/tdm_backend.c

index c83b3da..acbde8e 100644 (file)
@@ -53,14 +53,14 @@ _check_abi_version(tdm_backend_module *module, int abimaj, int abimin)
        int minor = TDM_BACKEND_GET_ABI_MINOR(module->abi_version);
 
        if (major < abimaj) goto failed;
-       if (major > abimaj) return 1;
+       if (major > abimaj) return 0;
        if (minor < abimin) goto failed;
-       return 1;
+       return 0;
 failed:
        TDM_ERR("The ABI version(%d.%d) of '%s' is less than %d.%d",
                        major, minor, module->name ? module->name : "unknown",
                        abimaj, abimin);
-       return 0;
+       return -1;
 }
 
 EXTERN tdm_error