ADT746X: logical-bitwise & confusion
Hi again:
Quoted 35 lines · Mark M. Hoffman
Hi:
Quoted 32 lines · Andrew Morton
From: Roel Kluin <[email protected]>
logical-bitwise & confusion
Signed-off-by Roel Kluin <[email protected]>Cc Mark M. Hoffman <[email protected]>Acked-by Colin Leroy <[email protected]>Cc Benjamin Herrenschmidt <[email protected]>Cc Segher Boessenkool <[email protected]>Cc "Darrick J. Wong" <[email protected]>Signed-off-by Andrew Morton <[email protected]>---
drivers/hwmon/adt7473.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)diff -puN
drivers/hwmon/adt7473.c~adt746x-logical-bitwise-confusion-in-set_max_duty_at_critdrivers/hwmon/adt7473.cdrivers/hwmon/adt7473.c renamed from drivers/hwmon/adt7473.c~adt746x-logical-bitwise-confusion-in-set_max_duty_at_crit +3
-3@@ -573,11 +573,11 @@ static ssize_t set_max_duty_at_crit(struconst char *buf, size_t count) { - u8 reg; + u8 reg, temp;struct i2c_client *client =to_i2c_client (dev);struct adt7473_data *data =i2c_get_clientdata (client); -int temp =simple_strtol (buf,NULL ,10 ); - temp = temp &&0xFF ; + + temp =simple_strtol (buf,NULL ,10 );
Quoted 5 lines
Quoted 3 lines
drivers/hwmon/adt7473.c renamed from drivers/hwmon/adt7473.c~adt746x-logical-bitwise-confusion-in-set_max_duty_at_crit +0
-0mutex_lock (&data->lock); data->max_duty_at_overheat = temp;_
Applied to hwmon-2.6.git/testing, thanks.
Oops. Thank you Jean for pointing out that the above is no good. How about this one instead...
commit ad49ac743a01705a77318a06831bb82b7f44c5ec
Author: Mark M. Hoffman <[email protected]> Date: Mon May 26 15:09:36 2008 -0400
hwmon: (adt7473) clarify an awkward bit of code
drivers/hwmon/adt7473.c +1 -2
@@ -572,10 +572,9 @@ static ssize_t set_max_duty_at_crit(struct device *dev,struct i2c_client *client =to_i2c_client (dev);struct adt7473_data *data =i2c_get_clientdata (client);int temp =simple_strtol (buf,NULL ,10 ); - temp = temp &&0xFF ;mutex_lock (&data->lock); - data->max_duty_at_overheat = temp; + data->max_duty_at_overheat = !!temp; reg =i2c_smbus_read_byte_data (client,ADT7473_REG_CFG4 );if (temp) reg |=ADT7473_CFG4_MAX_DUTY_AT_OVT ;
Signature · 8 lines
Mark M. Hoffman [email protected] _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Jean Delvare
Acked-byQuoted 62 lines · Mark M. Hoffman
Hi again:
Quoted 35 lines · Mark M. Hoffman
Hi:
Quoted 32 lines · Andrew Morton
From: Roel Kluin <[email protected]>
logical-bitwise & confusion
Signed-off-by Roel Kluin <[email protected]>Cc Mark M. Hoffman <[email protected]>Acked-by Colin Leroy <[email protected]>Cc Benjamin Herrenschmidt <[email protected]>Cc Segher Boessenkool <[email protected]>Cc "Darrick J. Wong" <[email protected]>Signed-off-by Andrew Morton <[email protected]>---
drivers/hwmon/adt7473.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)diff -puN
drivers/hwmon/adt7473.c~adt746x-logical-bitwise-confusion-in-set_max_duty_at_critdrivers/hwmon/adt7473.cdrivers/hwmon/adt7473.c renamed from drivers/hwmon/adt7473.c~adt746x-logical-bitwise-confusion-in-set_max_duty_at_crit +3
-3@@ -573,11 +573,11 @@ static ssize_t set_max_duty_at_crit(struconst char *buf, size_t count) { - u8 reg; + u8 reg, temp;struct i2c_client *client =to_i2c_client (dev);struct adt7473_data *data =i2c_get_clientdata (client); -int temp =simple_strtol (buf,NULL ,10 ); - temp = temp &&0xFF ; + + temp =simple_strtol (buf,NULL ,10 );Quoted 5 lines
Quoted 3 lines
drivers/hwmon/adt7473.c renamed from drivers/hwmon/adt7473.c~adt746x-logical-bitwise-confusion-in-set_max_duty_at_crit +0
-0mutex_lock (&data->lock); data->max_duty_at_overheat = temp;_
Applied to hwmon-2.6.git/testing, thanks.
Oops. Thank you Jean for pointing out that the above is no good. How about this one instead...
commit
ad49ac743a01705a77318a06831bb82b7f44c5ecAuthor: Mark M. Hoffman <[email protected]> Date: Mon May 26 15:09:36 2008 -0400hwmon: (adt7473) clarify an awkward bit of code
Signed-off-by Mark M. Hoffman <[email protected]>drivers/hwmon/adt7473.c +0
-0@@ -572,10 +572,9 @@ static ssize_t set_max_duty_at_crit(struct device *dev,struct i2c_client *client =to_i2c_client (dev);
drivers/hwmon/adt7473.c static ssize_t set_max_duty_at_crit(struct device *dev, · line 580
Quoted 10 lines
drivers/hwmon/adt7473.c +1
-2struct adt7473_data *data =i2c_get_clientdata (client);int temp =simple_strtol (buf,NULL ,10 ); - temp = temp &&0xFF ;mutex_lock (&data->lock); - data->max_duty_at_overheat = temp; + data->max_duty_at_overheat = !!temp; reg =i2c_smbus_read_byte_data (client,ADT7473_REG_CFG4 );if (temp) reg |=ADT7473_CFG4_MAX_DUTY_AT_OVT ;
Yep, much better.
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors