]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
i2c: mux: Simplify boolean assignment in i2c_mux_alloc
authorI Viswanath <viswanathiyyappan@gmail.com>
Mon, 25 Aug 2025 03:14:30 +0000 (08:44 +0530)
committerWolfram Sang <wsa+renesas@sang-engineering.com>
Thu, 25 Sep 2025 21:49:08 +0000 (23:49 +0200)
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>
drivers/i2c/i2c-mux.c

index 4d8690981a55dc0e1b35454971923791e6ed9f7f..d59644e50f14d09634d1c934740028031a647514 100644 (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;