Skip to contentSkip to conversation

thermal: Fix check of unsigned in thermal_cooling_device_cur_state_store()

PATCH New Roel Kluin 1 participant 1 message Oct 16, 2009 Thermal

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 thermal: Fix check of unsigned in thermal_cooling_device_cur_state_store()

state is unsigned long so the test does not work.

---
Is this the right fix? please review.

drivers/thermal/thermal_sys.c +1 -1
index 4e83c29..04970bf 100644
@@ -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);