thermal: sprd: remove build warnings 14/164814/1
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Thu, 21 Dec 2017 06:32:41 +0000 (15:32 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Thu, 21 Dec 2017 06:32:44 +0000 (15:32 +0900)
Remove build warnings including unused-function, unused-variable,
incompatible-pointer-types and int-conversion.

Change-Id: Iae52665eb828e1b958c0a34970a2b3152b0699eb
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
drivers/thermal/sprd_board_thm.c
drivers/thermal/sprd_cpu_cooling.c
drivers/thermal/sprd_ddie_thm.c
drivers/thermal/sprd_thm.c

index c340e3a..84481c2 100644 (file)
@@ -551,14 +551,14 @@ static int sprd_thermal_probe(struct platform_device *pdev)
        struct sprd_board_sensor_config *pconfig = NULL;
        int ret = 0;
        int temp_inteval;       
+#ifdef CONFIG_OF
+       struct device_node *np = pdev->dev.of_node;
+#endif
+
        pconfig = devm_kzalloc(&pdev->dev,
                             sizeof(struct sprd_board_sensor_config),
                             GFP_KERNEL);
        printk("sprd_thermal_probe---------start\n");
-               
-#ifdef CONFIG_OF
-       struct device_node *np = pdev->dev.of_node;
-#endif
 
 #ifdef CONFIG_OF
        if (!np) {
index 7c90a53..226430f 100644 (file)
@@ -165,7 +165,7 @@ static int set_cur_state(struct thermal_cooling_device *cdev,
        limit_freq = c_info->pdata->cpu_state[state].max_freq;
        max_core = c_info->pdata->cpu_state[state].max_core;
        c_info->enable = 1;
-       pr_info("%s %s: %d limit_freq: %d kHz max_core: %d\n",
+       pr_info("%s %s: %lu limit_freq: %d kHz max_core: %d\n",
                        cdev->type, __func__, state, limit_freq, max_core);
        cpufreq_thermal_limit(c_info->cluster, limit_freq);
        cpu_core_thermal_limit(c_info->cluster, max_core);
@@ -264,12 +264,12 @@ static struct sprd_cpu_cooling_platform_data *get_cpu_cooling_dt_data(
 
        if (!np) {
                dev_err(dev, "device node not found\n");
-               return -EINVAL;
+               return NULL;
        }
        pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
        if (!pdata) {
                dev_err(dev, "could not allocate memory for platform data\n");
-               return -1;
+               return NULL;
        }
        ret = of_property_read_u32(np, "cluster", &info->cluster);
        if(ret){
index 3e71c06..b34e274 100644 (file)
@@ -300,7 +300,7 @@ static int sprd_thm_regs_set(struct sprd_thermal_zone *pzone,unsigned int*regs)
        return 0;
 }
 #endif
-static int sprd_thm_temp_read(struct sprd_thermal_zone *pzone)
+static unsigned long sprd_thm_temp_read(struct sprd_thermal_zone *pzone)
 {
        u32 rawdata = 0;
        int cal_offset = 0;
@@ -452,13 +452,13 @@ int sprd_thm_hw_enable_sensor(struct sprd_thermal_zone *pzone)
                                (BIT_THM_RTC_EB | BIT_GPU_THMA_RTC_EB |
                                BIT_GPU_THMA_RTC_AUTO_EN | BIT_ARM_THMA_RTC_EB | BIT_ARM_THMA_RTC_AUTO_EN));
 #endif
-               __thm_reg_write((pzone->reg_base + SENSOR_CTRL + LOCAL_SENSOR_ADDR_OFF), 0x030, 0x0);
-               __thm_reg_write((pzone->reg_base + SENSOR_CTRL), 0x31, 0x0);
+               __thm_reg_write((uintptr_t)(pzone->reg_base + SENSOR_CTRL + LOCAL_SENSOR_ADDR_OFF), 0x030, 0x0);
+               __thm_reg_write((uintptr_t)(pzone->reg_base + SENSOR_CTRL), 0x31, 0x0);
        } else if (SPRD_GPU_SENSOR == pzone->sensor_id) {
                /*sci_glb_set(REG_AON_APB_APB_RTC_EB,
                                (BIT_THM_RTC_EB | BIT_GPU_THMA_RTC_EB |
                                BIT_GPU_THMA_RTC_AUTO_EN | BIT_ARM_THMA_RTC_EB |BIT_ARM_THMA_RTC_AUTO_EN ) );*/
-               __thm_reg_write((pzone->reg_base + SENSOR_CTRL+LOCAL_SENSOR_ADDR_OFF), 0x31, 0x0);
+               __thm_reg_write((uintptr_t)(pzone->reg_base + SENSOR_CTRL+LOCAL_SENSOR_ADDR_OFF), 0x31, 0x0);
        } else {
                THM_DEBUG("the sensor id is error \n");
        }
@@ -469,7 +469,6 @@ int sprd_thm_hw_enable_sensor(struct sprd_thermal_zone *pzone)
 u16 int_ctrl_reg[SPRD_MAX_SENSOR];
 int sprd_thm_hw_suspend(struct sprd_thermal_zone *pzone)
 {
-       u32 local_sen_id = 0;
        unsigned long local_sensor_addr;
        int ret = 0;
 
@@ -495,7 +494,6 @@ int sprd_thm_hw_suspend(struct sprd_thermal_zone *pzone)
 }
 int sprd_thm_hw_resume(struct sprd_thermal_zone *pzone)
 {
-       u32 local_sen_id = 0;
        unsigned long local_sensor_addr;
        int ret = 0;
 
index 288a4b3..a96e5cc 100644 (file)
@@ -317,10 +317,10 @@ logtime_store(struct device *dev, struct device_attribute *attr,
        //struct thermal_zone_device *tz = to_thermal_zone(dev);
        struct thermal_zone_device *tz = container_of(dev, struct thermal_zone_device, device);
        int result;
-    unsigned long logtime;
-    if (kstrtoul(buf, 10, &logtime))
+       unsigned long logtime;
+       if (kstrtoul(buf, 10, &logtime))
                return -EINVAL;
-               result = sprd_sys_set_logtime(tz, logtime);
+       result = sprd_sys_set_logtime(tz, logtime);
        if (result)
                return result;
 
@@ -616,7 +616,6 @@ static void thm_logtime_work(struct work_struct *work)
 {
        struct sprd_thermal_zone *pzone;
        int temp;
-       unsigned long volt = 0;
        pzone = container_of(work, struct sprd_thermal_zone, thm_logtime_work.work);
        temp = pzone->ops->read_temp(pzone);
     printk(" thm sensor id:%d, logtime:%ld, temp:%d\n", pzone->sensor_id,pzone->logtime,temp);