Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7d54d0d3 authored by Dan Carpenter's avatar Dan Carpenter Committed by Sebastian Reichel
Browse files

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: dbc4deda ("power: Adds support for Smart Battery System Manager")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.co.uk>
parent 4fbd8d19
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);