public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] thermal: Fix check of unsigned in thermal_cooling_device_cur_state_store()
@ 2009-10-16 13:35 Roel Kluin
  0 siblings, 0 replies; only message in thread
From: Roel Kluin @ 2009-10-16 13:35 UTC (permalink / raw)
  To: len.brown, rui.zhang, LKML, Andrew Morton

state is unsigned long so the test does not work.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
Is this the right fix? please review.

diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
index 4e83c29..04970bf 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);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-10-16 13:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-16 13:35 [PATCH] thermal: Fix check of unsigned in thermal_cooling_device_cur_state_store() Roel Kluin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox