From: Andi Shyti <andi.shyti@kernel.org>
To: Ruan Jinjie <ruanjinjie@huawei.com>
Cc: michael.hennerich@analog.com, peda@axentia.se, linux-i2c@vger.kernel.org
Subject: Re: [PATCH -next] i2c: mux: ltc4306: Remove an unnecessary ternary operator
Date: Sat, 5 Aug 2023 13:53:04 +0200 [thread overview]
Message-ID: <20230805115304.mas62dncqpznzane@intel.intel> (raw)
In-Reply-To: <20230801025328.3380963-1-ruanjinjie@huawei.com>
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@huawei.com>
> ---
> 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@kernel.org>
Thanks,
Andi
> }
>
> static const struct regmap_config ltc4306_regmap_config = {
> --
> 2.34.1
>
next prev parent reply other threads:[~2023-08-05 11:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-01 2:53 [PATCH -next] i2c: mux: ltc4306: Remove an unnecessary ternary operator Ruan Jinjie
2023-08-05 11:53 ` Andi Shyti [this message]
2023-08-05 11:55 ` Andi Shyti
2023-08-14 15:15 ` Wolfram Sang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230805115304.mas62dncqpznzane@intel.intel \
--to=andi.shyti@kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=michael.hennerich@analog.com \
--cc=peda@axentia.se \
--cc=ruanjinjie@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox