From: Daniel Thompson <daniel.thompson@linaro.org>
To: Doug Anderson <dianders@chromium.org>
Cc: Arnd Bergmann <arnd@kernel.org>,
Jason Wessel <jason.wessel@windriver.com>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Ingo Molnar <mingo@elte.hu>,
Christian Brauner <christian.brauner@ubuntu.com>,
kgdb-bugreport@lists.sourceforge.net,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] kgdb: fix gcc-11 warning on indentation
Date: Mon, 22 Mar 2021 19:23:13 +0000 [thread overview]
Message-ID: <20210322192313.fw46yficc7mfjinu@maple.lan> (raw)
In-Reply-To: <CAD=FV=WY6yxx+vkH+UU4VYei29xBftdnyRBE1OpEELmJ-kLfFg@mail.gmail.com>
On Mon, Mar 22, 2021 at 10:04:57AM -0700, Doug Anderson wrote:
> > + if (verbose) \
> > + printk(KERN_INFO a); \
> > +} while (0)
> > +#define v2printk(a...) do { \
> > + if (verbose > 1) \
> > + printk(KERN_INFO a); \
> > + touch_nmi_watchdog(); \
>
> This touch_nmi_watchdog() is pretty wonky. I guess maybe the
> assumption is that the "verbose level 2" prints are so chatty that the
> printing might prevent us from touching the NMI watchdog in the way
> that we normally do and thus we need an extra one here?
>
> ...but, in that case, I think the old code was _wrong_ and that the
> intention was that the touch_nmi_watchdog() should only be if "verose
> > 1" as the indentation implied. There doesn't feel like a reason to
> touch the watchdog if we're not doing anything slow.
I'm not entirely sure I'd like to second guess the intent here. This
macro has been there since this file was introduced but several callers
have been added since then. We have to guess their intent too!
So, whilst I think you are probably right, v2printk() does appears in
places such as the single step test loop which makes it pretty
difficult to decide by inspection whether or not touching the watchdog
is useful.
It's something that could be further examined... but I'd be a little
reluctant to combine it directly with a whitespace change!
Daniel.
prev parent reply other threads:[~2021-03-22 19:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-22 16:43 Arnd Bergmann
2021-03-22 17:03 ` Daniel Thompson
2021-03-22 18:03 ` Arnd Bergmann
2021-03-23 7:28 ` Greg Kroah-Hartman
2021-03-22 17:04 ` Doug Anderson
2021-03-22 18:18 ` Arnd Bergmann
2021-03-22 19:22 ` Doug Anderson
2021-03-22 20:14 ` Jason Wessel
2021-03-22 20:26 ` Arnd Bergmann
2021-03-22 19:23 ` Daniel Thompson [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=20210322192313.fw46yficc7mfjinu@maple.lan \
--to=daniel.thompson@linaro.org \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=christian.brauner@ubuntu.com \
--cc=dianders@chromium.org \
--cc=gregkh@linuxfoundation.org \
--cc=jason.wessel@windriver.com \
--cc=kgdb-bugreport@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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
all inboxes | Powered by JetHome®