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] [day] [month] [year] [list]
Date:   Mon, 24 Jun 2019 13:13:52 -0700
From:   Nick Desaulniers <ndesaulniers@...gle.com>
To:     Nathan Chancellor <natechancellor@...il.com>
Cc:     Russell King <linux@...linux.org.uk>,
        Linux ARM <linux-arm-kernel@...ts.infradead.org>,
        LKML <linux-kernel@...r.kernel.org>,
        clang-built-linux <clang-built-linux@...glegroups.com>
Subject: Re: [PATCH] ARM: iop13xx: Simplify iop13xx_atu{e,x}_pci_status checks

On Mon, Jun 17, 2019 at 7:03 PM Nathan Chancellor
<natechancellor@...il.com> wrote:
>
> clang warns:
>
> arch/arm/mach-iop13xx/pci.c:292:7: warning: logical not is only applied
> to the left hand side of this comparison [-Wlogical-not-parentheses]
>                 if (!iop13xx_atux_pci_status(1) == 0)
>                     ^                           ~~
> arch/arm/mach-iop13xx/pci.c:439:7: warning: logical not is only applied
> to the left hand side of this comparison [-Wlogical-not-parentheses]
>                 if (!iop13xx_atue_pci_status(1) == 0)
>                     ^                           ~~
>
> !func() == 0 is equivalent to func(), which clears up this warning and
> makes the code more readable.

Yep, this is more concise, thanks for the patch.
Reviewed-by: Nick Desaulniers <ndesaulniers@...gle.com>
please submit this to:
https://www.armlinux.org.uk/developer/patches/add.php

>
> Link: https://github.com/ClangBuiltLinux/linux/issues/543
> Reported-by: Nick Desaulniers <ndesaulniers@...gle.com>
> Signed-off-by: Nathan Chancellor <natechancellor@...il.com>
> ---
>  arch/arm/mach-iop13xx/pci.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-iop13xx/pci.c b/arch/arm/mach-iop13xx/pci.c
> index 46ea06e906cc..94d30bc7bba1 100644
> --- a/arch/arm/mach-iop13xx/pci.c
> +++ b/arch/arm/mach-iop13xx/pci.c
> @@ -289,7 +289,7 @@ iop13xx_atux_write_config(struct pci_bus *bus, unsigned int devfn, int where,
>
>         if (size != 4) {
>                 val = iop13xx_atux_read(addr);
> -               if (!iop13xx_atux_pci_status(1) == 0)
> +               if (iop13xx_atux_pci_status(1))
>                         return PCIBIOS_SUCCESSFUL;
>
>                 where = (where & 3) * 8;
> @@ -436,7 +436,7 @@ iop13xx_atue_write_config(struct pci_bus *bus, unsigned int devfn, int where,
>
>         if (size != 4) {
>                 val = iop13xx_atue_read(addr);
> -               if (!iop13xx_atue_pci_status(1) == 0)
> +               if (iop13xx_atue_pci_status(1))
>                         return PCIBIOS_SUCCESSFUL;
>
>                 where = (where & 3) * 8;
> --
> 2.22.0
>


-- 
Thanks,
~Nick Desaulniers

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ