Patchwork therm_adt746x: signed/unsigned confusion

login
register
mail settings
Submitter roel kluin
Date Jan. 18, 2009, 12:03 p.m.
Message ID <49731AA3.5020603@gmail.com>
Download mbox | patch
Permalink /patch/19171/
State Accepted
Commit 2e74778c76521f180516a593fb2b2786d6fffa4e
Delegated to: Benjamin Herrenschmidt
Headers show

Comments

roel kluin - Jan. 18, 2009, 12:03 p.m.
As suggested, this is used for signed rather than unsigned

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---

Patch

diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c
index 82607ad..c0621d5 100644
--- a/drivers/macintosh/therm_adt746x.c
+++ b/drivers/macintosh/therm_adt746x.c
@@ -498,8 +498,8 @@  static ssize_t store_##name(struct device *dev, struct device_attribute *attr, c
 #define BUILD_STORE_FUNC_INT(name, data)			\
 static ssize_t store_##name(struct device *dev, struct device_attribute *attr, const char *buf, size_t n) \
 {								\
-	u32 val;						\
-	val = simple_strtoul(buf, NULL, 10);			\
+	int val;						\
+	val = simple_strtol(buf, NULL, 10);			\
 	if (val < 0 || val > 255)				\
 		return -EINVAL;					\
 	printk(KERN_INFO "Setting specified fan speed to %d\n", val);	\