All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 5/9] adt746x: test below 0 on unsigned val
@ 2008-07-22  0:29 roel kluin
  0 siblings, 0 replies; only message in thread
From: roel kluin @ 2008-07-22  0:29 UTC (permalink / raw)
  To: colin; +Cc: linux-kernel

val is unsigned so the test doesn't work.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c
index 22bf981..f574077 100644
--- a/drivers/macintosh/therm_adt746x.c
+++ b/drivers/macintosh/therm_adt746x.c
@@ -500,7 +500,7 @@ static ssize_t store_##name(struct device *dev, struct device_attribute *attr, c
 {								\
 	u32 val;						\
 	val = simple_strtoul(buf, NULL, 10);			\
-	if (val < 0 || val > 255)				\
+	if (val > 255)						\
 		return -EINVAL;					\
 	printk(KERN_INFO "Setting specified fan speed to %d\n", val);	\
 	data = val;						\

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

only message in thread, other threads:[~2008-07-22  0:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-22  0:29 [PATCH 5/9] adt746x: test below 0 on unsigned val roel kluin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.