public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] i2c: mux: ltc4306: Remove an unnecessary ternary operator
@ 2023-08-01  2:53 Ruan Jinjie
  2023-08-05 11:53 ` Andi Shyti
  2023-08-05 11:55 ` Andi Shyti
  0 siblings, 2 replies; 4+ messages in thread
From: Ruan Jinjie @ 2023-08-01  2:53 UTC (permalink / raw)
  To: michael.hennerich, peda, linux-i2c; +Cc: ruanjinjie

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;
 }
 
 static const struct regmap_config ltc4306_regmap_config = {
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] i2c: mux: ltc4306: Remove an unnecessary ternary operator
  2023-08-01  2:53 [PATCH -next] i2c: mux: ltc4306: Remove an unnecessary ternary operator Ruan Jinjie
@ 2023-08-05 11:53 ` Andi Shyti
  2023-08-05 11:55 ` Andi Shyti
  1 sibling, 0 replies; 4+ messages in thread
From: Andi Shyti @ 2023-08-05 11:53 UTC (permalink / raw)
  To: Ruan Jinjie; +Cc: michael.hennerich, peda, linux-i2c

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
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] i2c: mux: ltc4306: Remove an unnecessary ternary operator
  2023-08-01  2:53 [PATCH -next] i2c: mux: ltc4306: Remove an unnecessary ternary operator Ruan Jinjie
  2023-08-05 11:53 ` Andi Shyti
@ 2023-08-05 11:55 ` Andi Shyti
  2023-08-14 15:15   ` Wolfram Sang
  1 sibling, 1 reply; 4+ messages in thread
From: Andi Shyti @ 2023-08-05 11:55 UTC (permalink / raw)
  To: michael.hennerich, peda, linux-i2c, Ruan Jinjie; +Cc: Andi Shyti

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

https://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux.git

Please note that this patch may still undergo further evaluation
and the final decision will be made in collaboration with
Wolfram.

Thank you,
Andi

Patches applied
===============
[1/1] i2c: mux: ltc4306: Remove an unnecessary ternary operator
      commit: 012d4d9a4683c592f5d3261d91b0c9ee320863ac

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] i2c: mux: ltc4306: Remove an unnecessary ternary operator
  2023-08-05 11:55 ` Andi Shyti
@ 2023-08-14 15:15   ` Wolfram Sang
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2023-08-14 15:15 UTC (permalink / raw)
  To: Andi Shyti; +Cc: michael.hennerich, peda, linux-i2c, Ruan Jinjie

[-- Attachment #1: Type: text/plain, Size: 364 bytes --]

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!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-08-14 15:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-01  2:53 [PATCH -next] i2c: mux: ltc4306: Remove an unnecessary ternary operator Ruan Jinjie
2023-08-05 11:53 ` Andi Shyti
2023-08-05 11:55 ` Andi Shyti
2023-08-14 15:15   ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox