thermal: cpu_cooling: get rid of a variable in cpufreq_set_cur_state()
authorViresh Kumar <viresh.kumar@linaro.org>
Tue, 25 Apr 2017 10:27:13 +0000 (15:57 +0530)
committerEduardo Valentin <edubezval@gmail.com>
Sun, 28 May 2017 00:32:20 +0000 (17:32 -0700)
'cpu' is used at only one place and there is no need to keep a separate
variable for it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Tested-by: Lukasz Luba <lukasz.luba@arm.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
drivers/thermal/cpu_cooling.c

index 1f4b6a719d05a8f3957e830e1b8b983ec6f91b0c..002b48dc6beaaa8924f77a4682de028a1b81cc03 100644 (file)
@@ -456,7 +456,6 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev,
                                 unsigned long state)
 {
        struct cpufreq_cooling_device *cpufreq_cdev = cdev->devdata;
-       unsigned int cpu = cpumask_any(&cpufreq_cdev->allowed_cpus);
        unsigned int clip_freq;
 
        /* Request state should be less than max_level */
@@ -471,7 +470,7 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev,
        cpufreq_cdev->cpufreq_state = state;
        cpufreq_cdev->clipped_freq = clip_freq;
 
-       cpufreq_update_policy(cpu);
+       cpufreq_update_policy(cpumask_any(&cpufreq_cdev->allowed_cpus));
 
        return 0;
 }