thermal: Fix test of unsigned in thermal_cooling_device_cur_state_store()
PATCH 1/1 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 <[email protected]>
---
Found using coccinelle: http://coccinelle.lip6.fr/
Is this the best way to fix this?
drivers/thermal/thermal_sys.c +1 -1
@@ -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);
Quoted 3 lines · Roel Kluin
state is unsigned long so the test did not work.
Signed-off-by Roel Kluin <[email protected]>
Acked-by Zhang Rui <[email protected]>
Quoted 18 lines
---
Found using coccinelle: http://coccinelle.lip6.fr/Is this the best way to fix this?
drivers/thermal/thermal_sys.c +1
-1@@ -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);