pass: hal: Remove the meaningless condition 88/147988/3 accepted/tizen/unified/20170913.070645 submit/tizen/20170911.052326
authorChanwoo Choi <cw00.choi@samsung.com>
Wed, 6 Sep 2017 07:53:14 +0000 (16:53 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Thu, 7 Sep 2017 04:57:19 +0000 (13:57 +0900)
The function in the src/pass/pass-hal.c checks whehter
'res_name'/'res_thermal_name' are NULL or not. But,
those are always not NULL.

This patch removes the meaningless condition for res_name/res_thermal_name.

Change-Id: I5727a4520cbceb05f73321d97b5c3cf2a38d33c7
Reported-by: Dongwoo Lee <dwoo08.lee@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
src/pass/pass-hal.c

index ffcfbdb966105e0bccd1b6666e670a64f1f6f3b4..fb9fe0ef6a3003eae57978c744a30de315d857c5 100644 (file)
@@ -103,7 +103,7 @@ int pass_get_curr_governor(struct pass_resource *res, char *governor)
        if (!dvfs)
                return -EINVAL;
 
-       if (!dvfs->get_curr_governor || !res_name)
+       if (!dvfs->get_curr_governor)
                return -EINVAL;
 
        return dvfs->get_curr_governor(res_name, governor);
@@ -125,7 +125,7 @@ int pass_set_curr_governor(struct pass_resource *res, char *governor)
        if (!dvfs)
                return -EINVAL;
 
-       if (!dvfs->set_curr_governor || !res_name)
+       if (!dvfs->set_curr_governor)
                return -EINVAL;
 
        return dvfs->set_curr_governor(res_name, governor);
@@ -148,7 +148,7 @@ int pass_get_curr_freq(struct pass_resource *res)
        if (!dvfs)
                return -EINVAL;
 
-       if (!dvfs->get_curr_freq || !res_name)
+       if (!dvfs->get_curr_freq)
                return -EINVAL;
 
        return dvfs->get_curr_freq(res_name);
@@ -171,7 +171,7 @@ int pass_get_min_freq(struct pass_resource *res)
        if (!dvfs)
                return -EINVAL;
 
-       if (!dvfs->get_min_freq || !res_name)
+       if (!dvfs->get_min_freq)
                return -EINVAL;
 
        return dvfs->get_min_freq(res_name);
@@ -193,7 +193,7 @@ int pass_set_min_freq(struct pass_resource *res, int freq)
        if (!dvfs)
                return -EINVAL;
 
-       if (!dvfs->set_min_freq || !res_name)
+       if (!dvfs->set_min_freq)
                return -EINVAL;
 
        return dvfs->set_min_freq(res_name, freq);
@@ -215,7 +215,7 @@ int pass_get_max_freq(struct pass_resource *res)
        if (!dvfs)
                return -EINVAL;
 
-       if (!dvfs->get_max_freq || !res_name)
+       if (!dvfs->get_max_freq)
                return -EINVAL;
 
        return dvfs->get_max_freq(res_name);
@@ -237,7 +237,7 @@ int pass_set_max_freq(struct pass_resource *res, int freq)
        if (!dvfs)
                return -EINVAL;
 
-       if (!dvfs->set_max_freq || !res_name)
+       if (!dvfs->set_max_freq)
                return -EINVAL;
 
        return dvfs->set_max_freq(res_name, freq);
@@ -260,7 +260,7 @@ int pass_get_available_min_freq(struct pass_resource *res)
        if (!dvfs)
                return -EINVAL;
 
-       if (!dvfs->get_available_min_freq || !res_name)
+       if (!dvfs->get_available_min_freq)
                return -EINVAL;
 
        return dvfs->get_available_min_freq(res_name);
@@ -282,7 +282,7 @@ int pass_get_available_max_freq(struct pass_resource *res)
        if (!dvfs)
                return -EINVAL;
 
-       if (!dvfs->get_available_max_freq || !res_name)
+       if (!dvfs->get_available_max_freq)
                return -EINVAL;
 
        return dvfs->get_available_max_freq(res_name);
@@ -305,7 +305,7 @@ int pass_get_up_threshold(struct pass_resource *res)
        if (!dvfs)
                return -EINVAL;
 
-       if (!dvfs->get_up_threshold || !res_name)
+       if (!dvfs->get_up_threshold)
                return -EINVAL;
 
        return dvfs->get_up_threshold(res_name);
@@ -327,7 +327,7 @@ int pass_set_up_threshold(struct pass_resource *res, int up_threshold)
        if (!dvfs)
                return -EINVAL;
 
-       if (!dvfs->set_up_threshold || !res_name)
+       if (!dvfs->set_up_threshold)
                return -EINVAL;
 
        return dvfs->set_up_threshold(res_name, up_threshold);
@@ -350,7 +350,7 @@ int pass_get_online_state(struct pass_resource *res, int cpu)
        if (!hotplug)
                return -EINVAL;
 
-       if (!hotplug->get_online_state || !res_name)
+       if (!hotplug->get_online_state)
                return -EINVAL;
 
        return hotplug->get_online_state(res_name, cpu);
@@ -372,7 +372,7 @@ int pass_set_online_state(struct pass_resource *res, int cpu, int on)
        if (!hotplug)
                return -EINVAL;
 
-       if (!hotplug->set_online_state || !res_name)
+       if (!hotplug->set_online_state)
                return -EINVAL;
 
        return hotplug->set_online_state(res_name, cpu, on);
@@ -394,7 +394,7 @@ int pass_get_online_min_num(struct pass_resource *res)
        if (!hotplug)
                return -EINVAL;
 
-       if ((!hotplug->get_online_min_num) || (!res_name))
+       if (!hotplug->get_online_min_num)
                return -EINVAL;
 
        return hotplug->get_online_min_num(res_name);
@@ -416,7 +416,7 @@ int pass_set_online_min_num(struct pass_resource *res, int num)
        if (!hotplug)
                return -EINVAL;
 
-       if ((!hotplug->set_online_min_num) || (!res_name))
+       if (!hotplug->set_online_min_num)
                return -EINVAL;
 
        return hotplug->set_online_min_num(res_name, num);
@@ -438,7 +438,7 @@ int pass_get_online_max_num(struct pass_resource *res)
        if (!hotplug)
                return -EINVAL;
 
-       if ((!hotplug->get_online_max_num) || (!res_name))
+       if (!hotplug->get_online_max_num)
                return -EINVAL;
 
        return hotplug->get_online_max_num(res_name);
@@ -460,7 +460,7 @@ int pass_set_online_max_num(struct pass_resource *res, int num)
        if (!hotplug)
                return -EINVAL;
 
-       if ((!hotplug->set_online_max_num) || (!res_name))
+       if (!hotplug->set_online_max_num)
                return -EINVAL;
 
        return hotplug->set_online_max_num(res_name, num);
@@ -488,7 +488,7 @@ int pass_get_temp(struct pass_resource *res)
        if (!tmu)
                return -EINVAL;
 
-       if (!tmu->get_temp || !res_thermal_name)
+       if (!tmu->get_temp)
                return -EINVAL;
 
        return tmu->get_temp(res_thermal_name);
@@ -515,7 +515,7 @@ int pass_get_tmu_policy(struct pass_resource *res, char *policy)
        if (!tmu)
                return -EINVAL;
 
-       if (!tmu->get_policy || !res_thermal_name)
+       if (!tmu->get_policy)
                return -EINVAL;
 
        return tmu->get_policy(res_thermal_name, policy);
@@ -594,7 +594,7 @@ int pass_set_pmqos_data(struct pass_resource *res, void *data)
                return -EINVAL;
        }
 
-       if (!nonstandard->set_pmqos_data || !res_name || !data)
+       if (!nonstandard->set_pmqos_data || !data)
                return -EINVAL;
 
        return nonstandard->set_pmqos_data(res_name, data);