linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Souptick Joarder <jrdr.linux@gmail.com>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: Mark Rutland <mark.rutland@arm.com>,
	Kernel test robot <lkp@intel.com>,
	Frederic Weisbecker <frederic@kernel.org>,
	linux-kernel@vger.kernel.org, Paul Mackerras <paulus@samba.org>,
	Nick Piggin <npiggin@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] powerpc/interrupt: Put braces around empty body in an 'if' statement
Date: Sun, 19 Jun 2022 12:13:47 +0530	[thread overview]
Message-ID: <CAFqt6zYZk43k7deHth3RZHgkD48EaN-et38fCtV97b_qKpy7QA@mail.gmail.com> (raw)
In-Reply-To: <48034eb1-3f37-f4fd-24b3-0eb7e517b35e@infradead.org>

On Sun, Jun 19, 2022 at 11:13 AM Randy Dunlap <rdunlap@infradead.org> wrote:
>
>
>
> On 6/18/22 20:11, Souptick Joarder wrote:
> > From: "Souptick Joarder (HPE)" <jrdr.linux@gmail.com>
> >
> > Kernel test robot throws warning ->
> >
> > arch/powerpc/kernel/interrupt.c:
> > In function 'interrupt_exit_kernel_prepare':
> >
> >>> arch/powerpc/kernel/interrupt.c:542:55: warning: suggest
> > braces around empty body in an 'if' statement [-Wempty-body]
> >      542 |                 CT_WARN_ON(ct_state() == CONTEXT_USER);
>
> That must be when CONFIG_CONTEXT_TRACKING_USER is not set/enabled.
> Can you confirm that?

Yes, CONFIG_CONTEXT_TRACKING_USER is not set.
>
> Then the preferable fix would be in <linux/context_tracking.h>:
>
> change
> #define CT_WARN_ON(cond)
>
> to either an empty do-while loop or a static inline function.
>
> (adding Frederic to Cc:)
>
> >
> > Fix it by adding braces.
> >
> > Reported-by: Kernel test robot <lkp@intel.com>
> > Signed-off-by: Souptick Joarder (HPE) <jrdr.linux@gmail.com>
> > ---
> >  arch/powerpc/kernel/interrupt.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/powerpc/kernel/interrupt.c b/arch/powerpc/kernel/interrupt.c
> > index 784ea3289c84..b8a918bab48f 100644
> > --- a/arch/powerpc/kernel/interrupt.c
> > +++ b/arch/powerpc/kernel/interrupt.c
> > @@ -538,8 +538,9 @@ notrace unsigned long interrupt_exit_kernel_prepare(struct pt_regs *regs)
> >        * CT_WARN_ON comes here via program_check_exception,
> >        * so avoid recursion.
> >        */
> > -     if (TRAP(regs) != INTERRUPT_PROGRAM)
> > +     if (TRAP(regs) != INTERRUPT_PROGRAM) {
> >               CT_WARN_ON(ct_state() == CONTEXT_USER);
> > +     }
> >
> >       kuap = kuap_get_and_assert_locked();
> >
>
> --
> ~Randy

  reply	other threads:[~2022-06-19  6:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-19  3:11 [PATCH] powerpc/interrupt: Put braces around empty body in an 'if' statement Souptick Joarder
2022-06-19  5:42 ` Randy Dunlap
2022-06-19  6:43   ` Souptick Joarder [this message]
2022-06-19  6:40 ` Christophe Leroy

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=CAFqt6zYZk43k7deHth3RZHgkD48EaN-et38fCtV97b_qKpy7QA@mail.gmail.com \
    --to=jrdr.linux@gmail.com \
    --cc=frederic@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lkp@intel.com \
    --cc=mark.rutland@arm.com \
    --cc=npiggin@gmail.com \
    --cc=paulus@samba.org \
    --cc=rdunlap@infradead.org \
    --cc=tglx@linutronix.de \
    /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).