mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 10:01:39 -05:00
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:
committed by
Wolfram Sang
parent
2b7a2003ba
commit
59ccb8176b
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user