aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2015-07-30 03:10:32 -0400
committerEduardo Valentin <edubezval@gmail.com>2015-08-14 21:26:22 -0400
commita24af233a1fd09002cabc05d6da248cc5656a2e1 (patch)
tree3a0dc316c1cd06e65ec744e7886a8028ecedf64c
parent166529c9b6f91b97d771e2e7ebf748aadb239b44 (diff)
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: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
-rw-r--r--drivers/thermal/cpu_cooling.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c
index 093537f00db3..1cf897cd993c 100644
--- a/drivers/thermal/cpu_cooling.c
+++ b/drivers/thermal/cpu_cooling.c
@@ -221,27 +221,21 @@ static int cpufreq_thermal_notifier(struct notifier_block *nb,
221 unsigned long max_freq; 221 unsigned long max_freq;
222 struct cpufreq_cooling_device *cpufreq_dev; 222 struct cpufreq_cooling_device *cpufreq_dev;
223 223
224 switch (event) { 224 if (event != CPUFREQ_ADJUST)
225 return NOTIFY_DONE;
225 226
226 case CPUFREQ_ADJUST: 227 mutex_lock(&cooling_list_lock);
227 mutex_lock(&cooling_list_lock); 228 list_for_each_entry(cpufreq_dev, &cpufreq_dev_list, node) {
228 list_for_each_entry(cpufreq_dev, &cpufreq_dev_list, node) { 229 if (!cpumask_test_cpu(policy->cpu, &cpufreq_dev->allowed_cpus))
229 if (!cpumask_test_cpu(policy->cpu, 230 continue;
230 &cpufreq_dev->allowed_cpus))
231 continue;
232 231
233 max_freq = cpufreq_dev->cpufreq_val; 232 max_freq = cpufreq_dev->cpufreq_val;
234 233
235 if (policy->max != max_freq) 234 if (policy->max != max_freq)
236 cpufreq_verify_within_limits(policy, 0, 235 cpufreq_verify_within_limits(policy, 0, max_freq);
237 max_freq);
238 break;
239 }
240 mutex_unlock(&cooling_list_lock);
241 break; 236 break;
242 default:
243 return NOTIFY_DONE;
244 } 237 }
238 mutex_unlock(&cooling_list_lock);
245 239
246 return NOTIFY_OK; 240 return NOTIFY_OK;
247} 241}