linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: Nathan Chancellor <natechancellor@gmail.com>
Cc: John Crispin <john@phrozen.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
	clang-built-linux@googlegroups.com,
	Dmitry Golovin <dima@golovin.in>
Subject: Re: [PATCH] MIPS: lantiq: Explicitly compare LTQ_EBU_PCC_ISTAT against 0
Date: Thu, 7 Jan 2021 17:26:40 +0100	[thread overview]
Message-ID: <20210107162640.GB11882@alpha.franken.de> (raw)
In-Reply-To: <20210105201548.50920-1-natechancellor@gmail.com>

On Tue, Jan 05, 2021 at 01:15:48PM -0700, Nathan Chancellor wrote:
> When building xway_defconfig with clang:
> 
> arch/mips/lantiq/irq.c:305:48: error: use of logical '&&' with constant
> operand [-Werror,-Wconstant-logical-operand]
>         if ((irq == LTQ_ICU_EBU_IRQ) && (module == 0) && LTQ_EBU_PCC_ISTAT)
>                                                       ^ ~~~~~~~~~~~~~~~~~
> arch/mips/lantiq/irq.c:305:48: note: use '&' for a bitwise operation
>         if ((irq == LTQ_ICU_EBU_IRQ) && (module == 0) && LTQ_EBU_PCC_ISTAT)
>                                                       ^~
>                                                       &
> arch/mips/lantiq/irq.c:305:48: note: remove constant to silence this
> warning
>         if ((irq == LTQ_ICU_EBU_IRQ) && (module == 0) && LTQ_EBU_PCC_ISTAT)
>                                                      ~^~~~~~~~~~~~~~~~~~~~
> 1 error generated.
> 
> Explicitly compare the constant LTQ_EBU_PCC_ISTAT against 0 to fix the
> warning. Additionally, remove the unnecessary parentheses as this is a
> simple conditional statement and shorthand '== 0' to '!'.
> 
> Fixes: 3645da0276ae ("OF: MIPS: lantiq: implement irq_domain support")
> Link: https://github.com/ClangBuiltLinux/linux/issues/807
> Reported-by: Dmitry Golovin <dima@golovin.in>
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> ---
>  arch/mips/lantiq/irq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

applied to mips-next.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

      reply	other threads:[~2021-01-07 16:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-05 20:15 [PATCH] MIPS: lantiq: Explicitly compare LTQ_EBU_PCC_ISTAT against 0 Nathan Chancellor
2021-01-07 16:26 ` Thomas Bogendoerfer [this message]

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=20210107162640.GB11882@alpha.franken.de \
    --to=tsbogend@alpha.franken.de \
    --cc=clang-built-linux@googlegroups.com \
    --cc=dima@golovin.in \
    --cc=john@phrozen.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=natechancellor@gmail.com \
    --cc=ndesaulniers@google.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;
as well as URLs for NNTP newsgroup(s).