From 60acb3891ff896ab28110c170e564ba5658b4aa5 Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Sun, 29 Dec 2013 23:47:38 +0100 Subject: thermal: exynos: fix error return code Set the return variable to an error code as done elsewhere in the function. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when != ret = e1 when != &ret *if(...) { ... when != ret = e2 when forall return ret; } // Signed-off-by: Julia Lawall Reviewed-by: Jingoo Han Signed-off-by: Zhang Rui --- drivers/thermal/samsung/exynos_tmu.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/thermal/samsung') diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 32f38b90c4f6..0d96a510389f 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -205,6 +205,7 @@ static int exynos_tmu_initialize(struct platform_device *pdev) skip_calib_data: if (pdata->max_trigger_level > MAX_THRESHOLD_LEVS) { dev_err(&pdev->dev, "Invalid max trigger level\n"); + ret = -EINVAL; goto out; } -- cgit v1.2.3 From b688b5bf845eb1fc3be06073a7be3ba6b7933f52 Mon Sep 17 00:00:00 2001 From: Naveen Krishna Chatradhi Date: Fri, 20 Dec 2013 17:42:07 +0530 Subject: thermal:samsung: fix compilation warning This patch fixes a compilation warning. warning: passing argument 5 of 'thermal_zone_device_register' discards 'const' qualifier from pointer target type [enabled by default] include/linux/thermal.h:270:29: note: expected 'struct thermal_zone_device_ops *' but argument is of type 'const struct thermal_zone_device_ops *' Signed-off-by: Naveen Krishna Chatradhi Signed-off-by: Zhang Rui --- drivers/thermal/samsung/exynos_thermal_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/thermal/samsung') diff --git a/drivers/thermal/samsung/exynos_thermal_common.c b/drivers/thermal/samsung/exynos_thermal_common.c index c2301da08ac7..3f5ad25ddca8 100644 --- a/drivers/thermal/samsung/exynos_thermal_common.c +++ b/drivers/thermal/samsung/exynos_thermal_common.c @@ -280,7 +280,7 @@ static int exynos_get_trend(struct thermal_zone_device *thermal, return 0; } /* Operation callback functions for thermal zone */ -static struct thermal_zone_device_ops const exynos_dev_ops = { +static struct thermal_zone_device_ops exynos_dev_ops = { .bind = exynos_bind, .unbind = exynos_unbind, .get_temp = exynos_get_temp, -- cgit v1.2.3