From: Chanwoo Choi Date: Wed, 6 Sep 2017 07:53:14 +0000 (+0900) Subject: pass: hal: Remove the meaningless condition X-Git-Tag: submit/tizen/20170911.052326^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=db5ca65bdc116a65a1745c49b91fbc1b7242da88;p=platform%2Fcore%2Fsystem%2Fpass.git pass: hal: Remove the meaningless condition 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 Signed-off-by: Chanwoo Choi --- diff --git a/src/pass/pass-hal.c b/src/pass/pass-hal.c index ffcfbdb..fb9fe0e 100644 --- a/src/pass/pass-hal.c +++ b/src/pass/pass-hal.c @@ -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);