From 47680b210dd91aa227587dc1940d710b4d8f03a6 Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Thu, 21 Dec 2017 15:32:41 +0900 Subject: [PATCH] thermal: sprd: remove build warnings Remove build warnings including unused-function, unused-variable, incompatible-pointer-types and int-conversion. Change-Id: Iae52665eb828e1b958c0a34970a2b3152b0699eb Signed-off-by: Seung-Woo Kim --- drivers/thermal/sprd_board_thm.c | 8 ++++---- drivers/thermal/sprd_cpu_cooling.c | 6 +++--- drivers/thermal/sprd_ddie_thm.c | 10 ++++------ drivers/thermal/sprd_thm.c | 7 +++---- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/drivers/thermal/sprd_board_thm.c b/drivers/thermal/sprd_board_thm.c index c340e3a..84481c2 100644 --- a/drivers/thermal/sprd_board_thm.c +++ b/drivers/thermal/sprd_board_thm.c @@ -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) { diff --git a/drivers/thermal/sprd_cpu_cooling.c b/drivers/thermal/sprd_cpu_cooling.c index 7c90a53..226430f 100644 --- a/drivers/thermal/sprd_cpu_cooling.c +++ b/drivers/thermal/sprd_cpu_cooling.c @@ -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){ diff --git a/drivers/thermal/sprd_ddie_thm.c b/drivers/thermal/sprd_ddie_thm.c index 3e71c06..b34e274 100644 --- a/drivers/thermal/sprd_ddie_thm.c +++ b/drivers/thermal/sprd_ddie_thm.c @@ -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; diff --git a/drivers/thermal/sprd_thm.c b/drivers/thermal/sprd_thm.c index 288a4b3..a96e5cc 100644 --- a/drivers/thermal/sprd_thm.c +++ b/drivers/thermal/sprd_thm.c @@ -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); -- 2.7.4