power: Fix type casting of set_current_state() 65/296665/1 accepted/tizen/unified/20230803.174810 accepted/tizen/unified/riscv/20230809.013257
authorYoungjae Cho <y0.cho@samsung.com>
Thu, 3 Aug 2023 02:03:49 +0000 (11:03 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Thu, 3 Aug 2023 02:09:26 +0000 (11:09 +0900)
The last set-value parameter, data4, receives address to the user_data,
which is type of 'const void *'.

Change-Id: I6eaf48357b8eb5c4bfc551832b3c35aff2b2aef7
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
src/power/resource-power.c

index 2297dd9..3951008 100644 (file)
@@ -43,13 +43,13 @@ static int set_current_state(int resource_id, const struct syscommon_resman_reso
        int reason;
        const void *user_data;
 
-       if (!data1 || !data2 || !data3)
+       if (!data1 || !data2 || !data3 || !data4)
                return -EINVAL;
 
        curr = *(uint64_t *) data1;
        next = *(uint64_t *) data2;
        reason = *(int *) data3;
-       user_data = data4;
+       user_data = *(const void **) data4;
 
        power_request_change_state_strict(curr, next, reason, user_data);