Message ID | 20230801025328.3380963-1-ruanjinjie@huawei.com |
---|---|
State | New |
Headers | show |
Series | [-next] i2c: mux: ltc4306: Remove an unnecessary ternary operator | expand |
On Sat, Aug 05, 2023 at 01:55:56PM +0200, Andi Shyti wrote: > Hi > > On Tue, 01 Aug 2023 10:53:28 +0800, Ruan Jinjie wrote: > > The true or false judgement of the ternary operator is unnecessary > > in C language semantics. So remove it to clean Code. > > > > > > Applied to i2c/andi-for-next on Applied to for-next (via Andi's branch), thanks!
diff --git a/drivers/i2c/muxes/i2c-mux-ltc4306.c b/drivers/i2c/muxes/i2c-mux-ltc4306.c index 5a03031519be..637e25506490 100644 --- a/drivers/i2c/muxes/i2c-mux-ltc4306.c +++ b/drivers/i2c/muxes/i2c-mux-ltc4306.c @@ -62,7 +62,7 @@ static const struct chip_desc chips[] = { static bool ltc4306_is_volatile_reg(struct device *dev, unsigned int reg) { - return (reg == LTC_REG_CONFIG) ? true : false; + return reg == LTC_REG_CONFIG; } static const struct regmap_config ltc4306_regmap_config = {
The true or false judgement of the ternary operator is unnecessary in C language semantics. So remove it to clean Code. Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com> --- drivers/i2c/muxes/i2c-mux-ltc4306.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)