hwmon: (f75375s) Fix bit shifting in f75375_write16
PATCH 3/4 hwmon: (f75375s) Fix bit shifting in f75375_write16
From: Nikolaus Schulz <[email protected]>
In order to extract the high byte of the 16-bit word, shift the word to the right, not to the left.
Signed-off-by Nikolaus Schulz <[email protected]>
--- drivers/hwmon/f75375s.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/hwmon/f75375s.c +1 -1
@@ -172,7 +172,7 @@ static inline void f75375_write8(struct i2c_client *client, u8 reg,static inline void f75375_write16 (struct i2c_client *client,u8 reg,u16 value) { -int err =i2c_smbus_write_byte_data (client, reg, (value <<8 )); +int err =i2c_smbus_write_byte_data (client, reg, (value >>8 ));if (err)return ;i2c_smbus_write_byte_data (client, reg +1 , (value &0xFF ));
Signature · 7 lines
1.7.9 _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Guenter Roeck
AppliedQuoted 16 lines · Nikolaus Schulz
From: Nikolaus Schulz <[email protected]>
In order to extract the high byte of the 16-bit word, shift the word to the right, not to the left.
Signed-off-by Nikolaus Schulz <[email protected]>--- drivers/hwmon/f75375s.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/hwmon/f75375s.c +0
-0
drivers/hwmon/f75375s.c static inline void f75375_write8(struct i2c_client *client, u8 reg, · line 178
Quoted 8 lines
drivers/hwmon/f75375s.c +1
-1@@ -172,7 +172,7 @@ static inline void f75375_write8(struct i2c_client *client, u8 reg,static inline void f75375_write16 (struct i2c_client *client,u8 reg,u16 value) { -int err =i2c_smbus_write_byte_data (client, reg, (value <<8 )); +int err =i2c_smbus_write_byte_data (client, reg, (value >>8 ));if (err)return ;i2c_smbus_write_byte_data (client, reg +1 , (value &0xFF ));
Again, nice catch. A bit puzzling, though, that this wasn't caught earlier.
Thanks, applied.
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors