From: Hyeonseong Gil Date: Tue, 7 Feb 2017 10:25:18 +0000 (+0900) Subject: [COMMON] thermal: cpu_cooling: Fix SVACE WGID 95804 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4837a4664ee2372652edba79f70790ffa405451e;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [COMMON] thermal: cpu_cooling: Fix SVACE WGID 95804 Signed-off-by: Hyeonseong Gil Resolved migration conflicts from kernel 4.9 to 4.14. - rename cpufreq_device -> cpufreq_cdev Change-Id: I59cab68f8a57608fe60963da5f69fcced809b397 --- diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c index a63323dd1eaf..4ec1cb74e463 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c @@ -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; }