public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: John Ogness <john.ogness@linutronix.de>
Cc: kernel test robot <lkp@intel.com>,
	kbuild-all@lists.01.org,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] printk/console: Check consistent sequence number when handling race in console_unlock()
Date: Wed, 30 Jun 2021 10:57:46 +0200	[thread overview]
Message-ID: <YNwyCqtpcFVlK+FP@alley> (raw)
In-Reply-To: <87zgv8bdei.fsf@jogness.linutronix.de>

On Tue 2021-06-29 22:59:57, John Ogness wrote:
> On 2021-06-30, kernel test robot <lkp@intel.com> wrote:
> >>> kernel/printk/printk.c:2548:6: warning: variable 'next_seq' set but not used [-Wunused-but-set-variable]
> 
> I suppose the correct fix for this warning would be to change the NOP
> macros. Currently they are:
> 
> #define prb_read_valid(rb, seq, r)      false
> #define prb_first_valid_seq(rb)         0
> 
> They should probably be something like (untested):
> 
> #define prb_read_valid(rb, seq, r)     \
> ({                                     \
>         (void)(rb);                    \
>         (void)(seq);                   \
>         (void)(r);                     \
>         false;                         \
> })

This did not work:

kernel/printk/printk.c: In function ‘console_unlock’:
kernel/printk/printk.c:2600:23: error: ‘prb’ undeclared (first use in this function)
   if (!prb_read_valid(prb, console_seq, &r))
                       ^
kernel/printk/printk.c:2230:16: note: in definition of macro ‘prb_read_valid’
         (void)(rb);                    \
                ^~
kernel/printk/printk.c:2600:23: note: each undeclared identifier is reported only once for each function it appears in
   if (!prb_read_valid(prb, console_seq, &r))
                       ^
kernel/printk/printk.c:2230:16: note: in definition of macro ‘prb_read_valid’
         (void)(rb);                    \
                ^~


Instead, it might be solved by declaring next_seq as:

	u64 __maybe_unused next_seq;

Any better idea is welcome. Well, it is not worth any big complexity.

Best Regards,
Petr

      reply	other threads:[~2021-06-30  8:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-29 14:33 [PATCH] printk/console: Check consistent sequence number when handling race in console_unlock() Petr Mladek
2021-06-29 14:48 ` John Ogness
2021-06-29 15:42 ` Sergey Senozhatsky
2021-06-30  7:58   ` Petr Mladek
2021-07-05  3:53     ` Sergey Senozhatsky
2021-06-29 19:44 ` kernel test robot
2021-06-29 20:53   ` John Ogness
2021-06-30  8:57     ` Petr Mladek [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=YNwyCqtpcFVlK+FP@alley \
    --to=pmladek@suse.com \
    --cc=john.ogness@linutronix.de \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.org \
    --cc=stable@vger.kernel.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