diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-11-07 15:43:22 +0300 |
---|---|---|
committer | Sebastian Reichel <sebastian.reichel@collabora.co.uk> | 2017-12-01 16:08:00 +0100 |
commit | 7d54d0d38ec42559c891526f079f1e035cd4b3ae (patch) | |
tree | 47373f4f669f0800e34172bca04fdd413aa68d0b /drivers | |
parent | 4fbd8d194f06c8a3fd2af1ce560ddb31f7ec8323 (diff) |
power: supply: sbs-message: double left shift bug in sbsm_select()
The original code does this: "1 << (1 << 11)" which is undefined in C.
Fixes: dbc4deda03fe ("power: Adds support for Smart Battery System Manager")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/power/supply/sbs-manager.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/power/supply/sbs-manager.c b/drivers/power/supply/sbs-manager.c index ccb4217b9638..cb6e8f66c7a2 100644 --- a/drivers/power/supply/sbs-manager.c +++ b/drivers/power/supply/sbs-manager.c @@ -183,7 +183,7 @@ static int sbsm_select(struct i2c_mux_core *muxc, u32 chan) return ret; /* chan goes from 1 ... 4 */ - reg = 1 << BIT(SBSM_SMB_BAT_OFFSET + chan); + reg = BIT(SBSM_SMB_BAT_OFFSET + chan); ret = sbsm_write_word(data->client, SBSM_CMD_BATSYSSTATE, reg); if (ret) dev_err(dev, "Failed to select channel %i\n", chan); |