Re: [PATCH -next] i2c: mux: ltc4306: Remove an unnecessary ternary operator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ruan,

On Tue, Aug 01, 2023 at 10:53:28AM +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.
> 
> Signed-off-by: Ruan Jinjie <ruanjinjie@xxxxxxxxxx>
> ---
>  drivers/i2c/muxes/i2c-mux-ltc4306.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 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;

This patch on its own is not bringing much improvement... I'm
taking it into my branch, but next time please insert it in a
wider scope.

Acked-by: Andi Shyti <andi.shyti@xxxxxxxxxx> 

Thanks,
Andi

>  }
>  
>  static const struct regmap_config ltc4306_regmap_config = {
> -- 
> 2.34.1
> 



[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux