pass: Fix build warnings 80/288280/1
authorDongwoo Lee <dwoo08.lee@samsung.com>
Tue, 14 Feb 2023 10:42:59 +0000 (19:42 +0900)
committerDongwoo Lee <dwoo08.lee@samsung.com>
Tue, 14 Feb 2023 10:43:48 +0000 (19:43 +0900)
Change-Id: I326e9f47c14b14312553ef49b6b5d180f3cf7bb9
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
src/resource/resource-system.c
tests/haltest/power-haltests.cpp

index 7940663..7148ffb 100644 (file)
@@ -260,9 +260,10 @@ static int system_get_memory_pressure_level(int resource_id,
        return 0;
 }
 
-static void system_handle_psi_listener(int resource_id,
-                                      const struct syscommon_resman_resource_attribute *attr,
-                                      void *data, int listener_type)
+static void
+system_handle_psi_listener(int resource_id,
+                          const struct syscommon_resman_resource_attribute *attr,
+                          void *data, enum syscommon_resman_listener_type listener_type)
 {
        struct system_resource_data *sysdata;
        struct timeval current;
@@ -337,7 +338,7 @@ static int system_check_memory_pressure_resolved(void *data, void **result)
 {
        struct syscommon_resman_resource_attribute dummy_attr;
        int mem_level_high = MEM_LEVEL_HIGH;
-       int resource_id = (int)data;
+       int resource_id = (int)(intptr_t)data;
 
        system_handle_psi_listener(resource_id, &dummy_attr,
                        &mem_level_high, SYSCOMMON_RESMAN_LISTENER_TYPE_EPOLL);
@@ -351,7 +352,7 @@ static int system_init_psi_listener(int resource_id,
        int i, ret;
 
        ret = create_timer_thread(&psi_timer, PSI_EVENT_RESOLVE_CHECK_RATE,
-                       system_check_memory_pressure_resolved, (void *)resource_id);
+                       system_check_memory_pressure_resolved, (void *)(intptr_t)resource_id);
        if (ret < 0)
                return ret;
 
index bf91eaa..d336cf9 100644 (file)
@@ -359,7 +359,8 @@ TEST_F(PowerHaltest, GetTmuPolicy_HandlesValidInput)
 TEST_F(PowerHaltest, GetOnlineState_HandlesValidInput)
 {
        int ret = 0;
-       unsigned int i, j;
+       unsigned int i;
+       int j;
 
        for (i = 0; i < g_pass.num_resources; i++) {
                struct pass_resource *res = &g_pass.res[i];
@@ -381,7 +382,8 @@ TEST_F(PowerHaltest, SetOnlineState_HandlesValidInput)
 {
        int ret = 0;
        int online_state = 0;
-       unsigned int i, j;
+       unsigned int i;
+       int j;
 
        for (i = 0; i < g_pass.num_resources; i++) {
                struct pass_resource *res = &g_pass.res[i];