power: bq27xxx_battery: signedness bug in bq27xxx_battery_read_health()
PATCH 1/1 power: bq27xxx_battery: signedness bug in bq27xxx_battery_read_health()
We need flags to be signed for the error handling to work.
Fixes 74aab849f342 ('power: bq27xxx_battery: Cleanup health checking')
Signed-off-by Dan Carpenter <[email protected]>
drivers/power/bq27xxx_battery.c +1 -1
@@ -691,7 +691,7 @@ static bool bq27xxx_battery_dead(struct bq27xxx_device_info *di, u16 flags)*/ static int bq27xxx_battery_read_health (struct bq27xxx_device_info *di) { -u16 flags; +int flags; flags =bq27xxx_read (di,BQ27XXX_REG_FLAGS , false);if (flags <0 ) {
Quoted 3 lines · Dan Carpenter
We need flags to be signed for the error handling to work.
Fixes 74aab849f342 ('power: bq27xxx_battery: Cleanup health checking')
This bug looks to have been added back in c91d36ea8116, either way the fix itself is correct so,
Quoted 2 lines
Signed-off-by Dan Carpenter <[email protected]>
Acked-by Andrew F. Davis <[email protected]>
Quoted 14 lines
drivers/power/bq27xxx_battery.c +1
-1@@ -691,7 +691,7 @@ static bool bq27xxx_battery_dead(struct bq27xxx_device_info *di, u16 flags)*/ static int bq27xxx_battery_read_health (struct bq27xxx_device_info *di) { -u16 flags; +int flags; flags =bq27xxx_read (di,BQ27XXX_REG_FLAGS , false);if (flags <0 ) {
Hi,
Quoted 4 lines · Dan Carpenter
We need flags to be signed for the error handling to work.
Fixes 74aab849f342 ('power: bq27xxx_battery: Cleanup health checking')Signed-off-by Dan Carpenter <[email protected]>
Thanks, Andrzej Hajda was slightly fast than you, so I merged his patch instead. I merged some of your patch description into his patch, though.
-- Sebastian