linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pinctrl: ocelot: Remove unnecessary conversion to bool
@ 2020-11-06  8:36 xiakaixu1987
  2020-11-10 14:09 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: xiakaixu1987 @ 2020-11-06  8:36 UTC (permalink / raw)
  To: linus.walleij; +Cc: linux-gpio, linux-kernel, Kaixu Xia

From: Kaixu Xia <kaixuxia@tencent.com>

Fix the following coccicheck warning:

./drivers/pinctrl/pinctrl-ocelot.c:732:28-33: WARNING: conversion to bool not needed here

Reported-by: Tosk Robot <tencent_os_robot@tencent.com>
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
---
 drivers/pinctrl/pinctrl-ocelot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/pinctrl-ocelot.c b/drivers/pinctrl/pinctrl-ocelot.c
index a4a1b00f7f0d..c2be5c44077f 100644
--- a/drivers/pinctrl/pinctrl-ocelot.c
+++ b/drivers/pinctrl/pinctrl-ocelot.c
@@ -729,7 +729,7 @@ static int ocelot_pinconf_get(struct pinctrl_dev *pctldev,
 		if (err)
 			return err;
 		if (param == PIN_CONFIG_BIAS_DISABLE)
-			val = (val == 0 ? true : false);
+			val = (val == 0);
 		else if (param == PIN_CONFIG_BIAS_PULL_DOWN)
 			val = (val & BIAS_PD_BIT ? true : false);
 		else    /* PIN_CONFIG_BIAS_PULL_UP */
-- 
2.20.0


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

* Re: [PATCH] pinctrl: ocelot: Remove unnecessary conversion to bool
  2020-11-06  8:36 [PATCH] pinctrl: ocelot: Remove unnecessary conversion to bool xiakaixu1987
@ 2020-11-10 14:09 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2020-11-10 14:09 UTC (permalink / raw)
  To: xiakaixu1987; +Cc: open list:GPIO SUBSYSTEM, linux-kernel, Kaixu Xia

On Fri, Nov 6, 2020 at 9:36 AM <xiakaixu1987@gmail.com> wrote:

> From: Kaixu Xia <kaixuxia@tencent.com>
>
> Fix the following coccicheck warning:
>
> ./drivers/pinctrl/pinctrl-ocelot.c:732:28-33: WARNING: conversion to bool not needed here
>
> Reported-by: Tosk Robot <tencent_os_robot@tencent.com>
> Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>

Patch applied.

Yours,
LInus Walleij

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

end of thread, other threads:[~2020-11-10 14:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-06  8:36 [PATCH] pinctrl: ocelot: Remove unnecessary conversion to bool xiakaixu1987
2020-11-10 14:09 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).