i2c: mux: Simplify boolean assignment in i2c_mux_alloc

Refactor boolean field assignments of the form `if (a) b = true` to
`b = !!(a)` in i2c_mux_alloc.

Signed-off-by: I Viswanath <viswanathiyyappan@gmail.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
This commit is contained in:
I Viswanath
2025-08-25 08:44:30 +05:30
committed by Wolfram Sang
parent 2b7a2003ba
commit 59ccb8176b

View File

@@ -241,12 +241,9 @@ struct i2c_mux_core *i2c_mux_alloc(struct i2c_adapter *parent,
muxc->parent = parent;
muxc->dev = dev;
if (flags & I2C_MUX_LOCKED)
muxc->mux_locked = true;
if (flags & I2C_MUX_ARBITRATOR)
muxc->arbitrator = true;
if (flags & I2C_MUX_GATE)
muxc->gate = true;
muxc->mux_locked = !!(flags & I2C_MUX_LOCKED);
muxc->arbitrator = !!(flags & I2C_MUX_ARBITRATOR);
muxc->gate = !!(flags & I2C_MUX_GATE);
muxc->select = select;
muxc->deselect = deselect;
muxc->max_adapters = max_adapters;