thermal: Fix test of unsigned in thermal_cooling_device_cur_state_store()
Roel Kluin [Tue, 15 Dec 2009 21:46:50 +0000 (22:46 +0100)]
state is unsigned long so the test did not work.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>

drivers/thermal/thermal_sys.c

index 6f8d8f9..800e0c5 100644 (file)
@@ -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);