Skip to contentSkip to conversation

adt746x: test below 0 on unsigned val

PATCH In review roel kluin 1 participant 1 message Jul 22, 2008

Subsystems (2)
lore
Share & tools
lore

roel kluin

author
#0 lore raw

PATCH 5/9 adt746x: test below 0 on unsigned val

val is unsigned so the test doesn't work.

---

drivers/macintosh/therm_adt746x.c +1 -1
index 22bf981..f574077 100644
@@ -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;						\