&&/|| confusion
PATCH 1/1 &&/|| confusion
&& / || confusion
Signed-off-by Roel Kluin <[email protected]>
---
drivers/hwmon/ltc4245.c +1 -1
@@ -456,7 +456,7 @@ static int ltc4245_check_control_reg(struct i2c_client *client, u8 reg, u8 bits) voff1 &= bits; voff2 &= bits; -if (v != voff1 || v != voff2) +if (v != voff1 && v != voff2)return -ENODEV ; }
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
drivers/hwmon/ltc4245.c static int ltc4245_check_control_reg(struct i2c_client *client, u8 reg, u8 bits) · line 461
Quoted 12 lines · I wrote:
drivers/hwmon/ltc4245.c +1
-1@@ -456,7 +456,7 @@ static int ltc4245_check_control_reg(struct i2c_client *client, u8 reg, u8 bits) voff1 &= bits; voff2 &= bits; -if (v != voff1 || v != voff2) +if (v != voff1 && v != voff2)return -ENODEV ; }
On second hand I am not so certain this is wrong. If so, sorry for the noise.
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 9 lines · Roel Kluin
Quoted 8 lines · I wrote:
drivers/hwmon/ltc4245.c +0
-0@@ -456,7 +456,7 @@ static int ltc4245_check_control_reg(struct i2c_client *client, u8 reg, u8 bits) voff1 &= bits; voff2 &= bits;
Quoted 7 lines
drivers/hwmon/ltc4245.c static int ltc4245_check_control_reg(struct i2c_client *client, u8 reg, u8 bits) · line 461
Quoted 4 lines
drivers/hwmon/ltc4245.c +1
-1-if (v != voff1 || v != voff2) +if (v != voff1 && v != voff2)return -ENODEV ; }On second hand I am not so certain this is wrong. If so, sorry for the noise.
The original code looks OK to me.
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors