Skip to content

Commit e5c87b7

Browse files
Stratos Karafotisrafaeljw
authored andcommitted
cpufreq: Fix checkpatch errors and warnings
Fix 2 checkpatch errors about using assignment in if condition, 1 checkpatch error about a required space after comma and 3 warnings about line over 80 characters. Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent bfa709b commit e5c87b7

1 file changed

Lines changed: 14 additions & 11 deletions

File tree

‎drivers/cpufreq/cpufreq.c‎

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -939,8 +939,11 @@ static int cpufreq_add_policy_cpu(struct cpufreq_policy *policy,
939939
up_write(&policy->rwsem);
940940

941941
if (has_target()) {
942-
if ((ret = __cpufreq_governor(policy, CPUFREQ_GOV_START)) ||
943-
(ret = __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS))) {
942+
ret = __cpufreq_governor(policy, CPUFREQ_GOV_START);
943+
if (!ret)
944+
ret = __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
945+
946+
if (ret) {
944947
pr_err("%s: Failed to start governor\n", __func__);
945948
return ret;
946949
}
@@ -1394,14 +1397,14 @@ static int __cpufreq_remove_dev_finish(struct device *dev,
13941397

13951398
if (!cpufreq_suspended)
13961399
cpufreq_policy_free(policy);
1397-
} else {
1398-
if (has_target()) {
1399-
if ((ret = __cpufreq_governor(policy, CPUFREQ_GOV_START)) ||
1400-
(ret = __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS))) {
1401-
pr_err("%s: Failed to start governor\n",
1402-
__func__);
1403-
return ret;
1404-
}
1400+
} else if (has_target()) {
1401+
ret = __cpufreq_governor(policy, CPUFREQ_GOV_START);
1402+
if (!ret)
1403+
ret = __cpufreq_governor(policy, CPUFREQ_GOV_LIMITS);
1404+
1405+
if (ret) {
1406+
pr_err("%s: Failed to start governor\n", __func__);
1407+
return ret;
14051408
}
14061409
}
14071410

@@ -2086,7 +2089,7 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy,
20862089
if (old_gov) {
20872090
__cpufreq_governor(policy, CPUFREQ_GOV_STOP);
20882091
up_write(&policy->rwsem);
2089-
__cpufreq_governor(policy,CPUFREQ_GOV_POLICY_EXIT);
2092+
__cpufreq_governor(policy, CPUFREQ_GOV_POLICY_EXIT);
20902093
down_write(&policy->rwsem);
20912094
}
20922095

0 commit comments

Comments
 (0)