[COMMON] thermal: cpu_cooling: Fix SVACE WGID 95804
authorHyeonseong Gil <hs.gil@samsung.com>
Tue, 7 Feb 2017 10:25:18 +0000 (19:25 +0900)
committerChungwoo Park <cww.park@samsung.com>
Mon, 21 May 2018 08:18:26 +0000 (17:18 +0900)
Signed-off-by: Hyeonseong Gil <hs.gil@samsung.com>
Resolved migration conflicts from kernel 4.9 to 4.14.
- rename cpufreq_device -> cpufreq_cdev

Change-Id: I59cab68f8a57608fe60963da5f69fcced809b397

drivers/thermal/cpu_cooling.c

index a63323dd1eafc8e49e2ca160c97e1fb01651d7a7..4ec1cb74e463e1d639958d485b8f159170b735fe 100644 (file)
@@ -327,6 +327,7 @@ static int lookup_static_power(struct cpufreq_cooling_device *cpufreq_cdev,
                unsigned long voltage, int temperature, u32 *power)
 {
        int volt_index = 0, temp_index = 0;
+       int index = 0;
        int num_cpus;
        int max_cpus;
        struct cpufreq_policy *policy = cpufreq_cdev->policy;
@@ -365,7 +366,8 @@ static int lookup_static_power(struct cpufreq_cooling_device *cpufreq_cdev,
        if (temp_index > cpufreq_cdev->var_temp_size)
                temp_index = cpufreq_cdev->var_temp_size;
 
-       *power = (unsigned int)cpufreq_cdev->var_table[volt_index * (cpufreq_cdev->var_temp_size + 1) + temp_index] * num_cpus / max_cpus;
+       index = (int)(volt_index * (cpufreq_cdev->var_temp_size + 1) + temp_index);
+       *power = (unsigned int)cpufreq_cdev->var_table[index] * num_cpus / max_cpus;
 
        return 0;
 }