From: Roel Kluin Date: Tue, 15 Dec 2009 21:46:50 +0000 (+0100) Subject: thermal: Fix test of unsigned in thermal_cooling_device_cur_state_store() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=edb949185210365f107ddc5efa60df105d25e1d7;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git thermal: Fix test of unsigned in thermal_cooling_device_cur_state_store() state is unsigned long so the test did not work. Signed-off-by: Roel Kluin Acked-by: Zhang Rui Signed-off-by: Len Brown --- diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c index 6f8d8f971212..800e0c56cc83 100644 --- a/drivers/thermal/thermal_sys.c +++ b/drivers/thermal/thermal_sys.c @@ -374,7 +374,7 @@ thermal_cooling_device_cur_state_store(struct device *dev, if (!sscanf(buf, "%ld\n", &state)) return -EINVAL; - if (state < 0) + if ((long)state < 0) return -EINVAL; result = cdev->ops->set_cur_state(cdev, state);