Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / Atom feed
From: Nick Desaulniers <ndesaulniers@google.com>
To: Nathan Chancellor <natechancellor@gmail.com>
Cc: clang-built-linux <clang-built-linux@googlegroups.com>,
	Russell King <linux@armlinux.org.uk>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ARM: iop13xx: Simplify iop13xx_atu{e, x}_pci_status checks
Date: Mon, 24 Jun 2019 13:13:52 -0700
Message-ID: <CAKwvOd=U7GOuZm82_-pOAVaU1FejuGASETyxVw00xnnj2rPoHA@mail.gmail.com> (raw)
In-Reply-To: <20190618020307.50917-1-natechancellor@gmail.com>

On Mon, Jun 17, 2019 at 7:03 PM Nathan Chancellor
<natechancellor@gmail.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@google.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@google.com>
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.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

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

      reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-18  2:03 [PATCH] ARM: iop13xx: Simplify iop13xx_atu{e,x}_pci_status checks Nathan Chancellor
2019-06-24 20:13 ` Nick Desaulniers [this message]

Reply instructions:

You may reply publically 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='CAKwvOd=U7GOuZm82_-pOAVaU1FejuGASETyxVw00xnnj2rPoHA@mail.gmail.com' \
    --to=ndesaulniers@google.com \
    --cc=clang-built-linux@googlegroups.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=natechancellor@gmail.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

Linux-ARM-Kernel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/0 linux-arm-kernel/git/0.git
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/1 linux-arm-kernel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arm-kernel linux-arm-kernel/ https://lore.kernel.org/linux-arm-kernel \
		linux-arm-kernel@lists.infradead.org infradead-linux-arm-kernel@archiver.kernel.org
	public-inbox-index linux-arm-kernel


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-arm-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox