Commit a24af233 authored by Viresh Kumar's avatar Viresh Kumar Committed by Eduardo Valentin

thermal/cpu_cooling: convert 'switch' block to 'if' block in notifier

We just need to take care of single event here and there is no need to
increase indentation level of most of the code (which causes lines
longer that 80 columns to break).

Kill the switch block.
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
parent 166529c9
...@@ -221,27 +221,21 @@ static int cpufreq_thermal_notifier(struct notifier_block *nb, ...@@ -221,27 +221,21 @@ static int cpufreq_thermal_notifier(struct notifier_block *nb,
unsigned long max_freq; unsigned long max_freq;
struct cpufreq_cooling_device *cpufreq_dev; struct cpufreq_cooling_device *cpufreq_dev;
switch (event) { if (event != CPUFREQ_ADJUST)
return NOTIFY_DONE;
case CPUFREQ_ADJUST: mutex_lock(&cooling_list_lock);
mutex_lock(&cooling_list_lock); list_for_each_entry(cpufreq_dev, &cpufreq_dev_list, node) {
list_for_each_entry(cpufreq_dev, &cpufreq_dev_list, node) { if (!cpumask_test_cpu(policy->cpu, &cpufreq_dev->allowed_cpus))
if (!cpumask_test_cpu(policy->cpu, continue;
&cpufreq_dev->allowed_cpus))
continue;
max_freq = cpufreq_dev->cpufreq_val; max_freq = cpufreq_dev->cpufreq_val;
if (policy->max != max_freq) if (policy->max != max_freq)
cpufreq_verify_within_limits(policy, 0, cpufreq_verify_within_limits(policy, 0, max_freq);
max_freq);
break;
}
mutex_unlock(&cooling_list_lock);
break; break;
default:
return NOTIFY_DONE;
} }
mutex_unlock(&cooling_list_lock);
return NOTIFY_OK; return NOTIFY_OK;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment