mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ray Jui <ray.jui@broadcom.com>
To: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>, rjui@broadcom.com
Cc: sbranden@broadcom.com, bcm-kernel-feedback-list@broadcom.com,
	linus.walleij@linaro.org, linux-arm-kernel@lists.infradead.org,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drivers/pinctrl/bcm: Simplify bool comparison
Date: Fri, 15 Jan 2021 10:24:51 -0800	[thread overview]
Message-ID: <64a316c8-bc53-69af-8325-2746f6f1827c@broadcom.com> (raw)
In-Reply-To: <1610705349-24310-1-git-send-email-abaci-bugfix@linux.alibaba.com>

[-- 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 --]

  reply	other threads:[~2021-01-15 18:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-15 10:09 Jiapeng Zhong
2021-01-15 18:24 ` Ray Jui [this message]
2021-01-18 15:29   ` Linus Walleij
2021-01-18 15:31 ` Linus Walleij

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=64a316c8-bc53-69af-8325-2746f6f1827c@broadcom.com \
    --to=ray.jui@broadcom.com \
    --cc=abaci-bugfix@linux.alibaba.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjui@broadcom.com \
    --cc=sbranden@broadcom.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

all inboxes | Powered by JetHome®