lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 15 Jan 2021 10:24:51 -0800
From:   Ray Jui <ray.jui@...adcom.com>
To:     Jiapeng Zhong <abaci-bugfix@...ux.alibaba.com>, rjui@...adcom.com
Cc:     sbranden@...adcom.com, bcm-kernel-feedback-list@...adcom.com,
        linus.walleij@...aro.org, linux-arm-kernel@...ts.infradead.org,
        linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drivers/pinctrl/bcm: Simplify bool comparison



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@...ux.alibaba.com>
> Signed-off-by: Jiapeng Zhong <abaci-bugfix@...ux.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;
> 

Download attachment "smime.p7s" of type "application/pkcs7-signature" (4151 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ