Skip to contentSkip to conversation

Allow writing of negative trigger temperatures

PATCH In review Christian Hohnstaedt 3 participants 6 messages Aug 16, 2007 – Sep 2, 2007 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Allow writing of negative trigger temperatures

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

---
 drivers/hwmon/ad7418.c    |    2 +-
 drivers/hwmon/adm1021.c   |    2 +-
 drivers/hwmon/asb100.c    |    4 ++--
 drivers/hwmon/ds1621.c    |    2 +-
 drivers/hwmon/lm75.c      |    2 +-
 drivers/hwmon/lm75.h      |    2 +-
 drivers/hwmon/lm77.c      |    2 +-
 drivers/hwmon/lm93.c      |   10 +++++-----
 drivers/hwmon/w83627ehf.c |    6 +++---
 drivers/hwmon/w83627hf.c  |    6 +++---
 drivers/hwmon/w83781d.c   |    2 +-
 11 files changed, 20 insertions(+), 20 deletions(-)
drivers/hwmon/ad7418.c +1 -1
index cc8b624..879ea72 100644
@@ -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);
drivers/hwmon/adm1021.c +1 -1
index c466329..33d3ef7 100644
@@ -161,7 +161,7 @@ static ssize_t set_##value(struct device *dev, struct device_attribute *attr, co
 {								\
 	struct i2c_client *client = to_i2c_client(dev);		\
 	struct adm1021_data *data = i2c_get_clientdata(client);	\
-	int temp = simple_strtoul(buf, NULL, 10);		\
+	long temp = simple_strtol(buf, NULL, 10);		\
 								\
 	mutex_lock(&data->update_lock);				\
 	data->value = TEMP_TO_REG(temp);			\
drivers/hwmon/asb100.c +2 -2
index 57b1c7b..55d92e1 100644
@@ -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) { \
drivers/hwmon/ds1621.c +1 -1
index 1212d6b..5a861f9 100644
@@ -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;
drivers/hwmon/lm75.c +1 -1
index a40166f..4fa3220 100644
@@ -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);
drivers/hwmon/lm75.h +1 -1
index af7dc65..7c93454 100644
@@ -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);
drivers/hwmon/lm77.c +1 -1
index dd969f1..46e3aba 100644
@@ -138,7 +138,7 @@ static ssize_t set_##value(struct device *dev, struct device_attribute *attr, co
 {										\
 	struct i2c_client *client = to_i2c_client(dev);				\
 	struct lm77_data *data = i2c_get_clientdata(client);			\
-	long val = simple_strtoul(buf, NULL, 10);				\
+	long val = simple_strtol(buf, NULL, 10);				\
 										\
 	mutex_lock(&data->update_lock);						\
 	data->value = val;				\
drivers/hwmon/lm93.c +5 -5
index d84f8bf..86c6c6e 100644
@@ -413,7 +413,7 @@ static int LM93_TEMP_FROM_REG(u8 reg)
 
 /* TEMP: 1/1000 degrees C (-128C to +127C)
    REG: 1C/bit, two's complement */
-static u8 LM93_TEMP_TO_REG(int temp)
+static u8 LM93_TEMP_TO_REG(long temp)
 {
 	int ntemp = SENSORS_LIMIT(temp, LM93_TEMP_MIN, LM93_TEMP_MAX);
 	ntemp += (ntemp<0 ? -500 : 500);
@@ -1268,7 +1268,7 @@ static ssize_t store_temp_min(struct device *dev, struct device_attribute *attr,
 	int nr = (to_sensor_dev_attr(attr))->index;
 	struct i2c_client *client = to_i2c_client(dev);
 	struct lm93_data *data = i2c_get_clientdata(client);
-	u32 val = simple_strtoul(buf, NULL, 10);
+	long val = simple_strtol(buf, NULL, 10);
 
 	mutex_lock(&data->update_lock);
 	data->temp_lim[nr].min = LM93_TEMP_TO_REG(val);
@@ -1298,7 +1298,7 @@ static ssize_t store_temp_max(struct device *dev, struct device_attribute *attr,
 	int nr = (to_sensor_dev_attr(attr))->index;
 	struct i2c_client *client = to_i2c_client(dev);
 	struct lm93_data *data = i2c_get_clientdata(client);
-	u32 val = simple_strtoul(buf, NULL, 10);
+	long val = simple_strtol(buf, NULL, 10);
 
 	mutex_lock(&data->update_lock);
 	data->temp_lim[nr].max = LM93_TEMP_TO_REG(val);
@@ -1329,7 +1329,7 @@ static ssize_t store_temp_auto_base(struct device *dev,
 	int nr = (to_sensor_dev_attr(attr))->index;
 	struct i2c_client *client = to_i2c_client(dev);
 	struct lm93_data *data = i2c_get_clientdata(client);
-	u32 val = simple_strtoul(buf, NULL, 10);
+	long val = simple_strtol(buf, NULL, 10);
 
 	mutex_lock(&data->update_lock);
 	data->block10.base[nr] = LM93_TEMP_TO_REG(val);
@@ -1360,7 +1360,7 @@ static ssize_t store_temp_auto_boost(struct device *dev,
 	int nr = (to_sensor_dev_attr(attr))->index;
 	struct i2c_client *client = to_i2c_client(dev);
 	struct lm93_data *data = i2c_get_clientdata(client);
-	u32 val = simple_strtoul(buf, NULL, 10);
+	long val = simple_strtol(buf, NULL, 10);
 
 	mutex_lock(&data->update_lock);
 	data->boost[nr] = LM93_TEMP_TO_REG(val);
drivers/hwmon/w83627ehf.c +3 -3
index c51ae2e..311987e 100644
@@ -223,7 +223,7 @@ temp1_from_reg(s8 reg)
 }
 
 static inline s8
-temp1_to_reg(int temp, int min, int max)
+temp1_to_reg(long temp, int min, int max)
 {
 	if (temp <= min)
 		return min / 1000;
@@ -800,7 +800,7 @@ store_temp1_##reg(struct device *dev, struct device_attribute *attr, \
 		  const char *buf, size_t count) \
 { \
 	struct w83627ehf_data *data = dev_get_drvdata(dev); \
-	u32 val = simple_strtoul(buf, NULL, 10); \
+	long val = simple_strtol(buf, NULL, 10); \
  \
 	mutex_lock(&data->update_lock); \
 	data->temp1_##reg = temp1_to_reg(val, -128000, 127000); \
@@ -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); \
drivers/hwmon/w83627hf.c +3 -3
index 7a4a15f..0866739 100644
@@ -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); \
 	 \
drivers/hwmon/w83781d.c +1 -1
index f85b48f..5783995 100644
@@ -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); \
 	 \
Signature · 7 lines
1.5.0.1


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Acked-by on v1 1/1
#1 lore raw

Re: [lm-sensors] [PATCH] Allow writing of negative trigger

Hi Christian, Mark,

Quoted 4 lines · Christian Hohnstaedt

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

Quoted 13 lines
---
 drivers/hwmon/ad7418.c    |    2 +-
 drivers/hwmon/adm1021.c   |    2 +-
 drivers/hwmon/asb100.c    |    4 ++--
 drivers/hwmon/ds1621.c    |    2 +-
 drivers/hwmon/lm75.c      |    2 +-
 drivers/hwmon/lm75.h      |    2 +-
 drivers/hwmon/lm77.c      |    2 +-
 drivers/hwmon/lm93.c      |   10 +++++-----
 drivers/hwmon/w83627ehf.c |    6 +++---
 drivers/hwmon/w83627hf.c  |    6 +++---
 drivers/hwmon/w83781d.c   |    2 +-
 11 files changed, 20 insertions(+), 20 deletions(-)

I retested w83627ehf and it's now OK for all temperature channels. I also tested adm1021, successfully. I can't test lm77 nor lm93 but the code looks right.

I had to rediff the adm1021 part due to this patch from Krzysztof Helt in Mark's tree:
http://lm-sensors.org/kernel?p=kernel/mhoffman/hwmon-2.6.git;a=commit;ha040d50b43652607ad4677fb4b0ba91ea33be3

So here is the updated patch. Mark, please apply.

From: Christian Hohnstaedt <[email protected]>
Subject: hwmon: Allow writing of negative trigger temperatures

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

---
 drivers/hwmon/ad7418.c    |    2 +-
 drivers/hwmon/adm1021.c   |    2 +-
 drivers/hwmon/asb100.c    |    4 ++--
 drivers/hwmon/ds1621.c    |    2 +-
 drivers/hwmon/lm75.c      |    2 +-
 drivers/hwmon/lm75.h      |    2 +-
 drivers/hwmon/lm77.c      |    2 +-
 drivers/hwmon/lm93.c      |   10 +++++-----
 drivers/hwmon/w83627ehf.c |    6 +++---
 drivers/hwmon/w83627hf.c  |    6 +++---
 drivers/hwmon/w83781d.c   |    2 +-
 11 files changed, 20 insertions(+), 20 deletions(-)
drivers/hwmon/ad7418.c +1 -1
@@ -172,7 +172,7 @@ static ssize_t set_temp(struct device *d
 	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);
drivers/hwmon/adm1021.c +1 -1
@@ -162,7 +162,7 @@ static ssize_t set_##value(struct device
 {									\
 	struct i2c_client *client = to_i2c_client(dev);			\
 	struct adm1021_data *data = i2c_get_clientdata(client);		\
-	int temp = simple_strtoul(buf, NULL, 10);			\
+	long temp = simple_strtol(buf, NULL, 10);			\
 									\
 	mutex_lock(&data->update_lock);					\
 	data->value = TEMP_TO_REG(temp);				\
drivers/hwmon/asb100.c +2 -2
@@ -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 *
 { \
 	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) { \
drivers/hwmon/ds1621.c +1 -1
@@ -151,7 +151,7 @@ static ssize_t set_temp(struct device *d
 	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;
drivers/hwmon/lm75.c +1 -1
@@ -95,7 +95,7 @@ static ssize_t set_temp(struct device *d
 	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);
drivers/hwmon/lm75.h +1 -1
@@ -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);
drivers/hwmon/lm77.c +1 -1
@@ -138,7 +138,7 @@ static ssize_t set_##value(struct device
 {										\
 	struct i2c_client *client = to_i2c_client(dev);				\
 	struct lm77_data *data = i2c_get_clientdata(client);			\
-	long val = simple_strtoul(buf, NULL, 10);				\
+	long val = simple_strtol(buf, NULL, 10);				\
 										\
 	mutex_lock(&data->update_lock);						\
 	data->value = val;				\
drivers/hwmon/lm93.c +5 -5
@@ -413,7 +413,7 @@ static int LM93_TEMP_FROM_REG(u8 reg)
 
 /* TEMP: 1/1000 degrees C (-128C to +127C)
    REG: 1C/bit, two's complement */
-static u8 LM93_TEMP_TO_REG(int temp)
+static u8 LM93_TEMP_TO_REG(long temp)
 {
 	int ntemp = SENSORS_LIMIT(temp, LM93_TEMP_MIN, LM93_TEMP_MAX);
 	ntemp += (ntemp<0 ? -500 : 500);
@@ -1268,7 +1268,7 @@ static ssize_t store_temp_min(struct dev
 	int nr = (to_sensor_dev_attr(attr))->index;
 	struct i2c_client *client = to_i2c_client(dev);
 	struct lm93_data *data = i2c_get_clientdata(client);
-	u32 val = simple_strtoul(buf, NULL, 10);
+	long val = simple_strtol(buf, NULL, 10);
 
 	mutex_lock(&data->update_lock);
 	data->temp_lim[nr].min = LM93_TEMP_TO_REG(val);
@@ -1298,7 +1298,7 @@ static ssize_t store_temp_max(struct dev
 	int nr = (to_sensor_dev_attr(attr))->index;
 	struct i2c_client *client = to_i2c_client(dev);
 	struct lm93_data *data = i2c_get_clientdata(client);
-	u32 val = simple_strtoul(buf, NULL, 10);
+	long val = simple_strtol(buf, NULL, 10);
 
 	mutex_lock(&data->update_lock);
 	data->temp_lim[nr].max = LM93_TEMP_TO_REG(val);
@@ -1329,7 +1329,7 @@ static ssize_t store_temp_auto_base(stru
 	int nr = (to_sensor_dev_attr(attr))->index;
 	struct i2c_client *client = to_i2c_client(dev);
 	struct lm93_data *data = i2c_get_clientdata(client);
-	u32 val = simple_strtoul(buf, NULL, 10);
+	long val = simple_strtol(buf, NULL, 10);
 
 	mutex_lock(&data->update_lock);
 	data->block10.base[nr] = LM93_TEMP_TO_REG(val);
@@ -1360,7 +1360,7 @@ static ssize_t store_temp_auto_boost(str
 	int nr = (to_sensor_dev_attr(attr))->index;
 	struct i2c_client *client = to_i2c_client(dev);
 	struct lm93_data *data = i2c_get_clientdata(client);
-	u32 val = simple_strtoul(buf, NULL, 10);
+	long val = simple_strtol(buf, NULL, 10);
 
 	mutex_lock(&data->update_lock);
 	data->boost[nr] = LM93_TEMP_TO_REG(val);
drivers/hwmon/w83627ehf.c +3 -3
@@ -223,7 +223,7 @@ temp1_from_reg(s8 reg)
 }
 
 static inline s8
-temp1_to_reg(int temp, int min, int max)
+temp1_to_reg(long temp, int min, int max)
 {
 	if (temp <= min)
 		return min / 1000;
@@ -805,7 +805,7 @@ store_temp1_##reg(struct device *dev, st
 		  const char *buf, size_t count) \
 { \
 	struct w83627ehf_data *data = dev_get_drvdata(dev); \
-	u32 val = simple_strtoul(buf, NULL, 10); \
+	long val = simple_strtol(buf, NULL, 10); \
  \
 	mutex_lock(&data->update_lock); \
 	data->temp1_##reg = temp1_to_reg(val, -128000, 127000); \
@@ -840,7 +840,7 @@ store_##reg(struct device *dev, struct d
 	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); \
drivers/hwmon/w83627hf.c +3 -3
@@ -263,7 +263,7 @@ static inline u8 FAN_TO_REG(long rpm, in
 
 /* 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);
@@ -639,9 +639,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); \
 	 \
drivers/hwmon/w83781d.c +1 -1
@@ -408,7 +408,7 @@ static ssize_t store_temp_##reg (struct 
 	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); \
 	 \
Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#2 lore raw

Re: [lm-sensors] [PATCH] Allow writing of negative trigger

In reply to Christian Hohnstaedt

Hi Jean, Christian:

Quoted 3 lines · Jean Delvare

I retested w83627ehf and it's now OK for all temperature channels. I also tested adm1021, successfully. I can't test lm77 nor lm93 but the code looks right.

There's always i2c-stub, but yeah, it looks OK to me too.

Quoted 3 lines

I had to rediff the adm1021 part due to this patch from Krzysztof Helt in Mark's tree:
http://lm-sensors.org/kernel?p=kernel/mhoffman/hwmon-2.6.git;a=commit;ha040d50b43652607ad4677fb4b0ba91ea33be3

I'm surprised that git couldn't merge that automatically (I tried).

BTW I don't mind if I have to do a bit of fixup to get a patch to apply to my testing branch. But of course I appreciate it if it's already taken care of - thanks Jean.

Quoted 10 lines

So here is the updated patch. Mark, please apply.

From: Christian Hohnstaedt <[email protected]>
Subject: hwmon: Allow writing of negative trigger temperatures

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

Applied to hwmon-2.6.git/testing, thanks.

Signature · 8 lines
Mark M. Hoffman
[email protected]


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#3 lore raw

Re: [lm-sensors] [PATCH] Allow writing of negative trigger

In reply to Christian Hohnstaedt

Hi Mark,

Quoted 8 lines · Mark M. Hoffman

Hi Jean, Christian:

Quoted 3 lines · Jean Delvare

I retested w83627ehf and it's now OK for all temperature channels. I also tested adm1021, successfully. I can't test lm77 nor lm93 but the code looks right.

There's always i2c-stub, but yeah, it looks OK to me too.

Unfortunately, I have neither lm77 nor lm93 dumps to load i2c-stub with. If anyone has such dumps and could share them...

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#4 lore raw

Re: [lm-sensors] [PATCH] Allow writing of negative trigger

In reply to Christian Hohnstaedt

Hi Jean:

Quoted 6 lines · Jean Delvare

Hi Mark,

Quoted 3 lines · Mark M. Hoffman

Hi Jean, Christian:

* Jean Delvare <[email protected]> [2007-08-16 11:40:10 +0200]:

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

I retested w83627ehf and it's now OK for all temperature channels. I also tested adm1021, successfully. I can't test lm77 nor lm93 but the code looks right.

There's always i2c-stub, but yeah, it looks OK to me too.

Unfortunately, I have neither lm77 nor lm93 dumps to load i2c-stub with. If anyone has such dumps and could share them...

BTW: you don't need them in this case. The following works just fine...

# modprobe i2c-stub chip-addr=0x2c
# modprobe lm93 force_lm93=1,0x2c	# replace '1' w/ ID of stub

Regards,

Signature · 8 lines
Mark M. Hoffman
[email protected]


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#5 lore raw

Re: [lm-sensors] [PATCH] Allow writing of negative trigger

In reply to Christian Hohnstaedt
Quoted 9 lines · Mark M. Hoffman
Quoted 2 lines · Jean Delvare

Unfortunately, I have neither lm77 nor lm93 dumps to load i2c-stub with. If anyone has such dumps and could share them...

BTW: you don't need them in this case. The following works just fine...

# modprobe i2c-stub chip-addr=0x2c
# modprobe lm93 force_lm93=1,0x2c	# replace '1' w/ ID of stub

Ah, good point, I didn't think about the force parameter.

That being said, I would still enjoy having dumps of these chips for more general testing where forcing an empty chip isn't sufficient.

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors