All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Hohnstaedt <chohnstaedt@innominate.com>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors]
Date: Wed, 15 Aug 2007 15:32:03 +0000	[thread overview]
Message-ID: <20070815153203.GD10132@tweety> (raw)
In-Reply-To: <87ekb9s3tn.wl%info@wore.ma.cx>

  - replace differing temperature variable types by long
  - use strtol() instead of strtoul() for conversion

Signed-off-by: Christian Hohnstaedt <chohnstaedt@innominate.com>
---
 drivers/hwmon/ad7418.c    |    2 +-
 drivers/hwmon/asb100.c    |    4 ++--
 drivers/hwmon/ds1621.c    |    2 +-
 drivers/hwmon/lm75.c      |    2 +-
 drivers/hwmon/lm75.h      |    2 +-
 drivers/hwmon/w83627ehf.c |    2 +-
 drivers/hwmon/w83627hf.c  |    6 +++---
 drivers/hwmon/w83781d.c   |    2 +-
 8 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/hwmon/ad7418.c b/drivers/hwmon/ad7418.c
index cc8b624..879ea72 100644
--- a/drivers/hwmon/ad7418.c
+++ b/drivers/hwmon/ad7418.c
@@ -172,7 +172,7 @@ static ssize_t set_temp(struct device *dev, struct device_attribute *devattr,
 	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
 	struct i2c_client *client = to_i2c_client(dev);
 	struct ad7418_data *data = i2c_get_clientdata(client);
-	int temp = simple_strtol(buf, NULL, 10);
+	long temp = simple_strtol(buf, NULL, 10);
 
 	mutex_lock(&data->lock);
 	data->temp[attr->index] = LM75_TEMP_TO_REG(temp);
diff --git a/drivers/hwmon/asb100.c b/drivers/hwmon/asb100.c
index 57b1c7b..55d92e1 100644
--- a/drivers/hwmon/asb100.c
+++ b/drivers/hwmon/asb100.c
@@ -143,7 +143,7 @@ static int FAN_FROM_REG(u8 val, int div)
 
 /* TEMP: 0.001C/bit (-128C to +127C)
    REG: 1C/bit, two's complement */
-static u8 TEMP_TO_REG(int temp)
+static u8 TEMP_TO_REG(long temp)
 {
 	int ntemp = SENSORS_LIMIT(temp, ASB100_TEMP_MIN, ASB100_TEMP_MAX);
 	ntemp += (ntemp<0 ? -500 : 500);
@@ -448,7 +448,7 @@ static ssize_t set_##reg(struct device *dev, const char *buf, \
 { \
 	struct i2c_client *client = to_i2c_client(dev); \
 	struct asb100_data *data = i2c_get_clientdata(client); \
-	unsigned long val = simple_strtoul(buf, NULL, 10); \
+	long val = simple_strtol(buf, NULL, 10); \
  \
 	mutex_lock(&data->update_lock); \
 	switch (nr) { \
diff --git a/drivers/hwmon/ds1621.c b/drivers/hwmon/ds1621.c
index 1212d6b..5a861f9 100644
--- a/drivers/hwmon/ds1621.c
+++ b/drivers/hwmon/ds1621.c
@@ -151,7 +151,7 @@ static ssize_t set_temp(struct device *dev, struct device_attribute *da,
 	struct sensor_device_attribute *attr = to_sensor_dev_attr(da);
 	struct i2c_client *client = to_i2c_client(dev);
 	struct ds1621_data *data = ds1621_update_client(dev);
-	u16 val = LM75_TEMP_TO_REG(simple_strtoul(buf, NULL, 10));
+	u16 val = LM75_TEMP_TO_REG(simple_strtol(buf, NULL, 10));
 
 	mutex_lock(&data->update_lock);
 	data->temp[attr->index] = val;
diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
index a40166f..4fa3220 100644
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -95,7 +95,7 @@ static ssize_t set_temp(struct device *dev, struct device_attribute *da,
 	struct i2c_client *client = to_i2c_client(dev);
 	struct lm75_data *data = i2c_get_clientdata(client);
 	int nr = attr->index;
-	unsigned long temp = simple_strtoul(buf, NULL, 10);
+	long temp = simple_strtol(buf, NULL, 10);
 
 	mutex_lock(&data->update_lock);
 	data->temp[nr] = LM75_TEMP_TO_REG(temp);
diff --git a/drivers/hwmon/lm75.h b/drivers/hwmon/lm75.h
index af7dc65..7c93454 100644
--- a/drivers/hwmon/lm75.h
+++ b/drivers/hwmon/lm75.h
@@ -33,7 +33,7 @@
 
 /* TEMP: 0.001C/bit (-55C to +125C)
    REG: (0.5C/bit, two's complement) << 7 */
-static inline u16 LM75_TEMP_TO_REG(int temp)
+static inline u16 LM75_TEMP_TO_REG(long temp)
 {
 	int ntemp = SENSORS_LIMIT(temp, LM75_TEMP_MIN, LM75_TEMP_MAX);
 	ntemp += (ntemp<0 ? -250 : 250);
diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c
index c51ae2e..e3ee30b 100644
--- a/drivers/hwmon/w83627ehf.c
+++ b/drivers/hwmon/w83627ehf.c
@@ -835,7 +835,7 @@ store_##reg(struct device *dev, struct device_attribute *attr, \
 	struct w83627ehf_data *data = dev_get_drvdata(dev); \
 	struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr); \
 	int nr = sensor_attr->index; \
-	u32 val = simple_strtoul(buf, NULL, 10); \
+	long val = simple_strtol(buf, NULL, 10); \
  \
 	mutex_lock(&data->update_lock); \
 	data->reg[nr] = LM75_TEMP_TO_REG(val); \
diff --git a/drivers/hwmon/w83627hf.c b/drivers/hwmon/w83627hf.c
index 7a4a15f..0866739 100644
--- a/drivers/hwmon/w83627hf.c
+++ b/drivers/hwmon/w83627hf.c
@@ -263,7 +263,7 @@ static inline u8 FAN_TO_REG(long rpm, int div)
 
 /* TEMP: 0.001C/bit (-128C to +127C)
    REG: 1C/bit, two's complement */
-static u8 TEMP_TO_REG(int temp)
+static u8 TEMP_TO_REG(long temp)
 {
         int ntemp = SENSORS_LIMIT(temp, TEMP_MIN, TEMP_MAX);
         ntemp += (ntemp<0 ? -500 : 500);
@@ -642,9 +642,9 @@ static ssize_t \
 store_temp_##reg (struct device *dev, const char *buf, size_t count, int nr) \
 { \
 	struct w83627hf_data *data = dev_get_drvdata(dev); \
-	u32 val; \
+	long val; \
 	 \
-	val = simple_strtoul(buf, NULL, 10); \
+	val = simple_strtol(buf, NULL, 10); \
 	 \
 	mutex_lock(&data->update_lock); \
 	 \
diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c
index f85b48f..5783995 100644
--- a/drivers/hwmon/w83781d.c
+++ b/drivers/hwmon/w83781d.c
@@ -410,7 +410,7 @@ static ssize_t store_temp_##reg (struct device *dev, \
 	struct sensor_device_attribute *attr = to_sensor_dev_attr(da); \
 	struct w83781d_data *data = dev_get_drvdata(dev); \
 	int nr = attr->index; \
-	s32 val; \
+	long val; \
 	 \
 	val = simple_strtol(buf, NULL, 10); \
 	 \
-- 
1.5.0.1


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

  parent reply	other threads:[~2007-08-15 15:32 UTC|newest]

Thread overview: 84+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-11 10:20 [lm-sensors] wore
2005-10-26 22:17 ` [lm-sensors] Mauro Carvalho Chehab
2005-10-26 22:40 ` [lm-sensors] Greg KH
2005-10-26 22:46 ` [lm-sensors] Jean Delvare
2005-10-27 14:03 ` [lm-sensors] Mauro Carvalho Chehab
2005-10-27 16:53 ` [lm-sensors] Mauro Carvalho Chehab
2005-10-27 23:07 ` [lm-sensors] Jean Delvare
2005-10-27 23:43 ` [lm-sensors] Jean Delvare
2006-05-05 19:34 ` [lm-sensors] Dieter Jurzitza
2006-05-05 20:53 ` [lm-sensors] Dieter Jurzitza
2006-05-30  8:53 ` [lm-sensors] Laurent Pinchart
2006-12-03  8:22 ` [lm-sensors] Udo van den Heuvel
2006-12-03  8:38 ` [lm-sensors] Thomas Dohl
2006-12-03  8:49 ` [lm-sensors] Udo van den Heuvel
2006-12-03 20:20 ` [lm-sensors] Thomas Dohl
2007-01-08  7:39 ` [lm-sensors] Christophe de Rivière
2007-04-15  7:48 ` [lm-sensors] jk
2007-05-10 17:36 ` [lm-sensors] Dieter Rogiest
2007-05-10 18:02 ` [lm-sensors] Hans-Jürgen Koch
2007-05-10 18:46 ` [lm-sensors] Stephen Cormier
2007-05-10 19:31 ` [lm-sensors] Rudolf Marek
2007-05-10 20:34 ` [lm-sensors] Dieter Rogiest
2007-05-10 22:28 ` [lm-sensors] Rudolf Marek
2007-05-10 22:40 ` [lm-sensors] Dieter Rogiest
2007-07-24 12:06 ` [lm-sensors] Jean Delvare
2007-07-24 12:57 ` [lm-sensors] Christian Hohnstaedt
2007-07-24 13:09 ` [lm-sensors] Jean Delvare
2007-07-24 13:43 ` [lm-sensors] Christian Hohnstaedt
2007-08-12 11:13 ` [lm-sensors] Jean Delvare
2007-08-13  8:39 ` [lm-sensors] Christian Hohnstaedt
2007-08-13 12:29 ` [lm-sensors] Jean Delvare
2007-08-15 15:32 ` Christian Hohnstaedt [this message]
2007-08-15 19:28 ` [lm-sensors] Jean Delvare
2007-08-16  8:08 ` [lm-sensors] Christian Hohnstaedt
2007-10-07 18:38 ` [lm-sensors] Hans de Goede
2007-10-07 19:33 ` [lm-sensors] Mark M. Hoffman
2007-10-31 15:29 ` [lm-sensors] Hans de Goede
2008-06-01 10:15 ` [lm-sensors] Dominik Geyer
2008-09-17 13:50 ` [lm-sensors] Frank Myhr
2010-03-09 22:50 ` [lm-sensors] Phillip Pi
2010-10-31  7:42 ` [lm-sensors] Zamzit
2011-01-20 20:04 ` [lm-sensors] Guenter Roeck
2011-01-24 21:20 ` [lm-sensors] Yu, Fenghua
2011-03-28 18:11 ` [lm-sensors] R, Durgadoss
2011-04-05 17:47 ` [lm-sensors] Guenter Roeck
2011-04-06  6:54 ` [lm-sensors] R, Durgadoss
2011-04-06  7:18 ` [lm-sensors] Guenter Roeck
2011-06-21  9:44 ` [lm-sensors] Jay Alexander Fleming
2011-06-23 21:30 ` [lm-sensors] Valentijn Scholten
2011-06-24 22:01 ` [lm-sensors] Valentijn Scholten
2011-06-25 18:44 ` [lm-sensors] Valentijn Scholten
2011-10-01 13:38 ` [lm-sensors] Maryvonne JUDIT
2011-10-23 14:53 ` [lm-sensors] Malika et Christophe CHARBONNIER
2011-12-22  9:33 ` [lm-sensors] serge chartrain
  -- strict thread matches above, loose matches on Subject: below --
2007-04-10 13:02 [lm-sensors] Hardware monitoring subsystem maintainer position is Jean Delvare
2007-04-12  5:57 ` [lm-sensors] Hardware monitoring subsystem maintainer Krzysztof Helt
2007-04-12  7:27   ` [lm-sensors] Hardware monitoring subsystem Hans de Goede
2007-04-15  2:07     ` [lm-sensors] Dmitry Torokhov
2008-09-18  8:12 [lm-sensors] + Sebastian Siewior
2008-09-18  8:15 ` Sebastian Siewior
2008-09-18  8:25 ` Andrew Morton
2008-09-18  9:08 ` Sebastian Siewior
2008-09-18 20:02 ` Jean Delvare
2008-09-18 21:13 ` Andrew Morton
2008-09-19 13:13 ` Jean Delvare
2009-06-12 15:25 [lm-sensors] =?UTF-8?Q?Re: [PATCH] hwmon: Add driver for VIA CPU tomaz.mertelj
2009-06-12 15:31 ` [lm-sensors] " Michael S. Zick
2009-06-12 16:04   ` Michael S. Zick
2009-06-12 17:38     ` [lm-sensors] Michael S. Zick
2009-06-12 18:16 [lm-sensors] =?UTF-8?Q?Re: [PATCH] hwmon: Add driver for VIA CPU tomaz.mertelj
2009-06-12 18:20 ` [lm-sensors] Michael S. Zick
2009-11-14  9:09 [lm-sensors] + Jean Delvare
2010-12-20  6:06 Patch[1/2]X86:Adding_Notification_Support_to_therm_throt.c R, Durgadoss
2010-12-20  6:18 ` [lm-sensors] R, Durgadoss
2010-12-28 10:25 Patch[1/2]X86:Adding_Notification_Support_to_therm_throt.c R, Durgadoss
2010-12-28 10:37 ` [lm-sensors] R, Durgadoss
2010-12-28 10:38 [lm-sensors] Patch[2/2]:hwmon:Adding_Threshold_Support_to_Coretemp.c R, Durgadoss
2011-01-04 19:40 ` [lm-sensors] Guenter Roeck
2011-01-03 11:52 Patch[1/2]X86:Adding_Notification_Support_to_therm_throt.c R, Durgadoss
2011-01-03 11:54 ` [lm-sensors] R, Durgadoss
2011-01-03 15:03 ` [lm-sensors] Guenter Roeck
2011-01-03 15:03   ` Patch[1/2]X86:Adding_Notification_Support_to_therm_throt.c Guenter Roeck
2011-01-03 15:11   ` Patch[1/2]X86:Adding_Notification_Support_to_therm_throt.c R, Durgadoss
2011-01-03 15:23     ` [lm-sensors] R, Durgadoss
2011-01-03 15:38     ` [lm-sensors] Guenter Roeck
2011-01-03 15:38       ` Patch[1/2]X86:Adding_Notification_Support_to_therm_throt.c Guenter Roeck
2011-01-04  8:56       ` Patch[1/2]X86:Adding_Notification_Support_to_therm_throt.c R, Durgadoss
2011-01-04  9:08         ` [lm-sensors] R, Durgadoss
2011-01-04  8:20 ` [tip:x86/hwmon] x86, hwmon: Add core threshold notification to therm_throt.c tip-bot for R, Durgadoss
2011-01-04  8:29   ` R, Durgadoss
2011-01-20  7:57 [lm-sensors] patch[1/1]:hwmon:Adding_Threshold_support_to_coretemp R, Durgadoss
2011-01-20 22:17 ` [lm-sensors] Fenghua Yu
2011-01-21  2:26   ` [lm-sensors] Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070815153203.GD10132@tweety \
    --to=chohnstaedt@innominate.com \
    --cc=lm-sensors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.