All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers/pinctrl/bcm: Simplify bool comparison
@ 2021-01-15 10:09 ` Jiapeng Zhong
  0 siblings, 0 replies; 8+ messages in thread
From: Jiapeng Zhong @ 2021-01-15 10:09 UTC (permalink / raw)
  To: rjui
  Cc: sbranden, bcm-kernel-feedback-list, linus.walleij,
	linux-arm-kernel, linux-gpio, linux-kernel, Jiapeng Zhong

Fix the follow coccicheck warnings:

./drivers/pinctrl/bcm/pinctrl-ns2-mux.c:856:29-38: WARNING:
Comparison to bool.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>
---
 drivers/pinctrl/bcm/pinctrl-ns2-mux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/bcm/pinctrl-ns2-mux.c b/drivers/pinctrl/bcm/pinctrl-ns2-mux.c
index 57044ab..0fe4a1f 100644
--- a/drivers/pinctrl/bcm/pinctrl-ns2-mux.c
+++ b/drivers/pinctrl/bcm/pinctrl-ns2-mux.c
@@ -853,7 +853,7 @@ static int ns2_pin_config_get(struct pinctrl_dev *pctldev, unsigned int pin,
 	switch (param) {
 	case PIN_CONFIG_BIAS_DISABLE:
 		ns2_pin_get_pull(pctldev, pin, &pull_up, &pull_down);
-		if ((pull_up == false) && (pull_down == false))
+		if (!pull_up && !pull_down)
 			return 0;
 		else
 			return -EINVAL;
-- 
1.8.3.1


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

* [PATCH] drivers/pinctrl/bcm: Simplify bool comparison
@ 2021-01-15 10:09 ` Jiapeng Zhong
  0 siblings, 0 replies; 8+ messages in thread
From: Jiapeng Zhong @ 2021-01-15 10:09 UTC (permalink / raw)
  To: rjui
  Cc: sbranden, linus.walleij, linux-kernel, Jiapeng Zhong, linux-gpio,
	bcm-kernel-feedback-list, linux-arm-kernel

Fix the follow coccicheck warnings:

./drivers/pinctrl/bcm/pinctrl-ns2-mux.c:856:29-38: WARNING:
Comparison to bool.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>
---
 drivers/pinctrl/bcm/pinctrl-ns2-mux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pinctrl/bcm/pinctrl-ns2-mux.c b/drivers/pinctrl/bcm/pinctrl-ns2-mux.c
index 57044ab..0fe4a1f 100644
--- a/drivers/pinctrl/bcm/pinctrl-ns2-mux.c
+++ b/drivers/pinctrl/bcm/pinctrl-ns2-mux.c
@@ -853,7 +853,7 @@ static int ns2_pin_config_get(struct pinctrl_dev *pctldev, unsigned int pin,
 	switch (param) {
 	case PIN_CONFIG_BIAS_DISABLE:
 		ns2_pin_get_pull(pctldev, pin, &pull_up, &pull_down);
-		if ((pull_up == false) && (pull_down == false))
+		if (!pull_up && !pull_down)
 			return 0;
 		else
 			return -EINVAL;
-- 
1.8.3.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] drivers/pinctrl/bcm: Simplify bool comparison
  2021-01-15 10:09 ` Jiapeng Zhong
@ 2021-01-15 18:24   ` Ray Jui
  -1 siblings, 0 replies; 8+ messages in thread
From: Ray Jui @ 2021-01-15 18:24 UTC (permalink / raw)
  To: Jiapeng Zhong, rjui
  Cc: sbranden, bcm-kernel-feedback-list, linus.walleij,
	linux-arm-kernel, linux-gpio, linux-kernel

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



On 1/15/2021 2:09 AM, Jiapeng Zhong wrote:
> Fix the follow coccicheck warnings:
> 
> ./drivers/pinctrl/bcm/pinctrl-ns2-mux.c:856:29-38: WARNING:
> Comparison to bool.
> 

Sorry I must be missing something here. Why is there a warning while
'pull_up' and 'pull_down' are already of type 'bool' and compared to
'false'?

> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>
> ---
>  drivers/pinctrl/bcm/pinctrl-ns2-mux.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pinctrl/bcm/pinctrl-ns2-mux.c b/drivers/pinctrl/bcm/pinctrl-ns2-mux.c
> index 57044ab..0fe4a1f 100644
> --- a/drivers/pinctrl/bcm/pinctrl-ns2-mux.c
> +++ b/drivers/pinctrl/bcm/pinctrl-ns2-mux.c
> @@ -853,7 +853,7 @@ static int ns2_pin_config_get(struct pinctrl_dev *pctldev, unsigned int pin,
>  	switch (param) {
>  	case PIN_CONFIG_BIAS_DISABLE:
>  		ns2_pin_get_pull(pctldev, pin, &pull_up, &pull_down);
> -		if ((pull_up == false) && (pull_down == false))
> +		if (!pull_up && !pull_down)


Looks fine as improvement, but I'm curious why there's a warning to
start with.

Thanks,

Ray

>  			return 0;
>  		else
>  			return -EINVAL;
> 

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4151 bytes --]

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

* Re: [PATCH] drivers/pinctrl/bcm: Simplify bool comparison
@ 2021-01-15 18:24   ` Ray Jui
  0 siblings, 0 replies; 8+ messages in thread
From: Ray Jui @ 2021-01-15 18:24 UTC (permalink / raw)
  To: Jiapeng Zhong, rjui
  Cc: sbranden, linus.walleij, linux-kernel, linux-gpio,
	bcm-kernel-feedback-list, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 1209 bytes --]



On 1/15/2021 2:09 AM, Jiapeng Zhong wrote:
> Fix the follow coccicheck warnings:
> 
> ./drivers/pinctrl/bcm/pinctrl-ns2-mux.c:856:29-38: WARNING:
> Comparison to bool.
> 

Sorry I must be missing something here. Why is there a warning while
'pull_up' and 'pull_down' are already of type 'bool' and compared to
'false'?

> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>
> ---
>  drivers/pinctrl/bcm/pinctrl-ns2-mux.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pinctrl/bcm/pinctrl-ns2-mux.c b/drivers/pinctrl/bcm/pinctrl-ns2-mux.c
> index 57044ab..0fe4a1f 100644
> --- a/drivers/pinctrl/bcm/pinctrl-ns2-mux.c
> +++ b/drivers/pinctrl/bcm/pinctrl-ns2-mux.c
> @@ -853,7 +853,7 @@ static int ns2_pin_config_get(struct pinctrl_dev *pctldev, unsigned int pin,
>  	switch (param) {
>  	case PIN_CONFIG_BIAS_DISABLE:
>  		ns2_pin_get_pull(pctldev, pin, &pull_up, &pull_down);
> -		if ((pull_up == false) && (pull_down == false))
> +		if (!pull_up && !pull_down)


Looks fine as improvement, but I'm curious why there's a warning to
start with.

Thanks,

Ray

>  			return 0;
>  		else
>  			return -EINVAL;
> 

[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4151 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] drivers/pinctrl/bcm: Simplify bool comparison
  2021-01-15 18:24   ` Ray Jui
@ 2021-01-18 15:29     ` Linus Walleij
  -1 siblings, 0 replies; 8+ messages in thread
From: Linus Walleij @ 2021-01-18 15:29 UTC (permalink / raw)
  To: Ray Jui
  Cc: Jiapeng Zhong, Ray Jui, Scott Branden, bcm-kernel-feedback-list,
	Linux ARM, open list:GPIO SUBSYSTEM, linux-kernel

On Fri, Jan 15, 2021 at 7:24 PM Ray Jui <ray.jui@broadcom.com> wrote:

> > -             if ((pull_up == false) && (pull_down == false))
> > +             if (!pull_up && !pull_down)
>
> Looks fine as improvement, but I'm curious why there's a warning to
> start with.

There is no semantic difference. This is a purely syntactic warning.

Yours,
Linus Walleij

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

* Re: [PATCH] drivers/pinctrl/bcm: Simplify bool comparison
@ 2021-01-18 15:29     ` Linus Walleij
  0 siblings, 0 replies; 8+ messages in thread
From: Linus Walleij @ 2021-01-18 15:29 UTC (permalink / raw)
  To: Ray Jui
  Cc: Scott Branden, Ray Jui, linux-kernel, Jiapeng Zhong,
	open list:GPIO SUBSYSTEM, bcm-kernel-feedback-list, Linux ARM

On Fri, Jan 15, 2021 at 7:24 PM Ray Jui <ray.jui@broadcom.com> wrote:

> > -             if ((pull_up == false) && (pull_down == false))
> > +             if (!pull_up && !pull_down)
>
> Looks fine as improvement, but I'm curious why there's a warning to
> start with.

There is no semantic difference. This is a purely syntactic warning.

Yours,
Linus Walleij

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] drivers/pinctrl/bcm: Simplify bool comparison
  2021-01-15 10:09 ` Jiapeng Zhong
@ 2021-01-18 15:31   ` Linus Walleij
  -1 siblings, 0 replies; 8+ messages in thread
From: Linus Walleij @ 2021-01-18 15:31 UTC (permalink / raw)
  To: Jiapeng Zhong
  Cc: Ray Jui, Scott Branden, bcm-kernel-feedback-list, Linux ARM,
	open list:GPIO SUBSYSTEM, linux-kernel

On Fri, Jan 15, 2021 at 11:09 AM Jiapeng Zhong
<abaci-bugfix@linux.alibaba.com> wrote:

> Fix the follow coccicheck warnings:
>
> ./drivers/pinctrl/bcm/pinctrl-ns2-mux.c:856:29-38: WARNING:
> Comparison to bool.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>

Patch applied.

Yours,
Linus Walleij

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

* Re: [PATCH] drivers/pinctrl/bcm: Simplify bool comparison
@ 2021-01-18 15:31   ` Linus Walleij
  0 siblings, 0 replies; 8+ messages in thread
From: Linus Walleij @ 2021-01-18 15:31 UTC (permalink / raw)
  To: Jiapeng Zhong
  Cc: Scott Branden, Ray Jui, linux-kernel, open list:GPIO SUBSYSTEM,
	bcm-kernel-feedback-list, Linux ARM

On Fri, Jan 15, 2021 at 11:09 AM Jiapeng Zhong
<abaci-bugfix@linux.alibaba.com> wrote:

> Fix the follow coccicheck warnings:
>
> ./drivers/pinctrl/bcm/pinctrl-ns2-mux.c:856:29-38: WARNING:
> Comparison to bool.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>

Patch applied.

Yours,
Linus Walleij

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2021-01-18 16:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-15 10:09 [PATCH] drivers/pinctrl/bcm: Simplify bool comparison Jiapeng Zhong
2021-01-15 10:09 ` Jiapeng Zhong
2021-01-15 18:24 ` Ray Jui
2021-01-15 18:24   ` Ray Jui
2021-01-18 15:29   ` Linus Walleij
2021-01-18 15:29     ` Linus Walleij
2021-01-18 15:31 ` Linus Walleij
2021-01-18 15:31   ` Linus Walleij

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.