[COMMON] thermal: fix prevent error
authorEunseok Choi <es10.choi@samsung.com>
Fri, 24 Nov 2017 01:58:21 +0000 (10:58 +0900)
committerChungwoo Park <cww.park@samsung.com>
Mon, 21 May 2018 08:22:08 +0000 (17:22 +0900)
CID: 202888 202205 202201 201542 200628 200625

Resolved migration conflicts from kernel 4.9 to 4.14.
- rename cpufreq_device -> cpufreq_cdev
- rename gpufreq_device -> gpufreq_cdev

Change-Id: I926e40f0539d4b795be2e34d55108d3b3c0dfdc9
Signed-off-by: Eunseok Choi <es10.choi@samsung.com>
drivers/thermal/cpu_cooling.c
drivers/thermal/gpu_cooling.c
drivers/thermal/isp_cooling.c
drivers/thermal/power_allocator.c
drivers/thermal/samsung/exynos_tmu.c

index aa49fd3f8763795b5f6b6ed02a6e83123b1f5202..d52e5612363f7c9c527579fbd2b8351817b83e56 100644 (file)
@@ -383,7 +383,7 @@ static int lookup_static_power(struct cpufreq_cooling_device *cpufreq_cdev,
        temperature  = temperature / 1000;
 
        for (volt_index = 0; volt_index <= cpufreq_cdev->var_volt_size; volt_index++) {
-               if (voltage < cpufreq_cdev->var_table[volt_index * (cpufreq_cdev->var_temp_size + 1)]) {
+               if (voltage < cpufreq_cdev->var_table[volt_index * ((int)cpufreq_cdev->var_temp_size + 1)]) {
                        volt_index = volt_index - 1;
                        break;
                }
index 3f88c4240e53c1c539cb440bbac0ed59c39a44cf..514a2a2fcfd22b2a4c556c7a137cff15f9280fdb 100644 (file)
@@ -427,7 +427,7 @@ static int lookup_static_power(struct gpufreq_cooling_device *gpufreq_cdev,
        temperature  = temperature / 1000;
 
        for (volt_index = 0; volt_index <= gpufreq_cdev->var_volt_size; volt_index++) {
-               if (voltage < gpufreq_cdev->var_table[volt_index * (gpufreq_cdev->var_temp_size + 1)]) {
+               if (voltage < gpufreq_cdev->var_table[volt_index * ((int)gpufreq_cdev->var_temp_size + 1)]) {
                        volt_index = volt_index - 1;
                        break;
                }
@@ -1063,7 +1063,7 @@ static int gpu_cooling_table_init(void)
 
                gpu_freq_table[count].flags = 0;
                gpu_freq_table[count].driver_data = count;
-               gpu_freq_table[count].frequency = freq * 1000;
+               gpu_freq_table[count].frequency = (unsigned int)freq * 1000;
 
                pr_info("[GPU cooling] index : %d, frequency : %d\n",
                        gpu_freq_table[count].driver_data, gpu_freq_table[count].frequency);
index 8f2100d0d57445aac1bbd0c81b691aa0e6d969e1..7978fcd72b11e597c10e3e11f5e30af16373a030 100644 (file)
@@ -262,7 +262,7 @@ static int isp_apply_cooling(struct isp_cooling_device *isp_device,
        if (isp_device->isp_state == cooling_state)
                return 0;
 
-       isp_device->isp_state = cooling_state;
+       isp_device->isp_state = (unsigned int)cooling_state;
 
        blocking_notifier_call_chain(&isp_notifier, ISP_THROTTLING, &cooling_state);
 
index e8728b52d942ba34cb8098f2d5b4e93349d46e27..e987f8b2938d45f3ae3addd5c724d4785bb21f98 100644 (file)
@@ -234,8 +234,8 @@ static u32 pid_controller(struct thermal_zone_device *tz,
                s64 i_next = i + mul_frac(tz->tzp->k_i, err);
                s64 i_windup = int_to_frac(-1 * (s64)tz->tzp->sustainable_power);
 
-               if (i_next > int_to_frac(tz->tzp->integral_max)) {
-                       i = int_to_frac(tz->tzp->integral_max);
+               if (i_next > int_to_frac((s64)tz->tzp->integral_max)) {
+                       i = int_to_frac((s64)tz->tzp->integral_max);
                        params->err_integral = div_frac(i, tz->tzp->k_i);
                } else if (i_next <= i_windup) {
                        i = i_windup;
@@ -532,7 +532,7 @@ static void get_governor_trips(struct thermal_zone_device *tz,
 
 static void reset_pid_controller(struct power_allocator_params *params, struct thermal_zone_device *tz)
 {
-       s64 i = int_to_frac(tz->tzp->integral_max);
+       s64 i = int_to_frac((s64)tz->tzp->integral_max);
 
        params->err_integral = div_frac(i, tz->tzp->k_i);
        params->prev_err = 0;
index 966a120d041e2f4c663d516d233cd7e858e2128f..710ac56b407126af9e3ae3de3039ab612cf64e5b 100644 (file)
@@ -925,7 +925,7 @@ static int exynos_map_dt_data(struct platform_device *pdev)
        struct exynos_tmu_data *data = platform_get_drvdata(pdev);
        struct exynos_tmu_platform_data *pdata;
        struct resource res;
-       int i;
+       unsigned int i;
        const char *temp, *tmu_name;
 
        if (!data || !pdev->dev.of_node)
@@ -977,7 +977,7 @@ static int exynos_map_dt_data(struct platform_device *pdev)
        else {
                for (i = 0; i<ARRAY_SIZE(sensing_method); i++)
                        if (!strcasecmp(temp, sensing_method[i]))
-                               data->sensing_mode = i;
+                               data->sensing_mode = (int)i;
        }
 
        data->balance_offset = DEFAULT_BALANCE_OFFSET;