From: Wook Song Date: Fri, 28 Jul 2017 01:23:39 +0000 (+0900) Subject: pmqos: Fix build warning caused by mis-type casting X-Git-Tag: submit/tizen/20170821.043932~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4fc15ed3c4b3eae91ac6bc4991d2c6ddd1cfeedf;p=platform%2Fcore%2Fsystem%2Fpass.git pmqos: Fix build warning caused by mis-type casting This patch fixes a build warning caused by mis-type casting from a pointer to a int type while building the package for aarch64. On the 32-bit environment, the size of a pointer is 4 bytes which is the same size of a int type. However, on the other hand, on the 64-bit environment, the size of a pointer is 8 bytes while the size of a int type is still 4 bytes. This is the main reason of the build warning. According to the booting_done_received function in sre/core/boot.c, a pointer of the int variable, done, is passed as the first argument, a void pointer, of the notifier call back functions. Therefore, such type casting from a void pointer to int is unnecssary and seems to be buggy. This patch modifies it to cast the type from void pointer to int pointer. Change-Id: I1dc9932b11a2800c56de23bbdb4a3dd66cee854f Signed-off-by: Wook Song Reviewed-by: Chanwoo Choi --- diff --git a/src/pmqos/pmqos.c b/src/pmqos/pmqos.c index 9cf9f6d..39b6308 100644 --- a/src/pmqos/pmqos.c +++ b/src/pmqos/pmqos.c @@ -18,7 +18,6 @@ #include -#include #include #include #include @@ -65,7 +64,7 @@ static void pmqos_free(void); static DBusMessage* e_dbus_start_cb(E_DBus_Object *obj, DBusMessage* msg) { DBusMessage *ret_dbus = NULL; - bool booting_done = true; + int booting_done = 1; int ret; ret = pmqos_init_done(&booting_done, NULL); @@ -375,17 +374,17 @@ static const struct edbus_method edbus_methods[] = { static int pmqos_init_done(void *data, void *user_data) { struct edbus_method *methods = NULL; - int booting_done; + int *booting_done; int ret, size; /* * As a callback function for the booting-done event, it is notified * with the result of the booting_finished() function by using the - * first argument, void *data. When it is successfully booted up, 1 is - * passed with the first argument. + * first argument, void *data. When it is successfully booted up, an int + * value, 1 is passed with the first argument. */ - booting_done = (int)data; - if (!booting_done) + booting_done = (int *) data; + if (!(*booting_done)) return -EINVAL; /* register edbus methods */