diff options
| author | I Viswanath <viswanathiyyappan@gmail.com> | 2025-08-25 08:44:30 +0530 |
|---|---|---|
| committer | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2025-09-25 23:49:08 +0200 |
| commit | 59ccb8176bd7e826d47962e891b460284f6978f0 (patch) | |
| tree | ea165a90c29efeb0e1d28c57ec1884d3ebd1c052 /drivers/i2c | |
| parent | 2b7a2003ba01cde9a4958a50c55207f820766816 (diff) | |
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>
Diffstat (limited to 'drivers/i2c')
| -rw-r--r-- | drivers/i2c/i2c-mux.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c index 4d8690981a55..d59644e50f14 100644 --- a/drivers/i2c/i2c-mux.c +++ b/drivers/i2c/i2c-mux.c @@ -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; |
