linux-mm.kvack.org archive mirror
 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>,
	Thomas Gleixner <tglx@linutronix.de>,
	oe-kbuild-all@lists.linux.dev,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [linux-next:master 5670/6619] kernel/printk/printk.c:2871:24: warning: array subscript 0 is outside array bounds of 'char[0]'
Date: Wed, 20 Sep 2023 13:11:04 +0200	[thread overview]
Message-ID: <ZQrTSImvuKq6gq68@alley> (raw)
In-Reply-To: <87a5thtas5.fsf@jogness.linutronix.de>

On Wed 2023-09-20 12:16:50, John Ogness wrote:
> On 2023-09-20, kernel test robot <lkp@intel.com> wrote:
> >    kernel/printk/printk.c: In function 'console_flush_all':
> >>> kernel/printk/printk.c:2871:24: warning: array subscript 0 is outside array bounds of 'char[0]' [-Warray-bounds]
> >     2871 |         char *outbuf = &printk_shared_pbufs.outbuf[0];
> >          |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> It is crazy all the things that get compiled in !CONFIG_PRINTK. We
> definitely need to fix that after this rework.
> 
> As for this warning, anyone have anything against something like:
> 
> #ifdef CONFIG_PRINTK
> static bool console_emit_next_record(struct console *con, bool *handover, int cookie)
> {
>    ... implementation ...
> }
> #else
> static bool console_emit_next_record(struct console *con, bool *handover, int cookie)
> {
>         *handover = false;
>         return false;
> }
> #endif

Looks good to me.

Best Regards,
Petr


      reply	other threads:[~2023-09-20 11:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-20  9:40 kernel test robot
2023-09-20 10:10 ` John Ogness
2023-09-20 11:11   ` 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=ZQrTSImvuKq6gq68@alley \
    --to=pmladek@suse.com \
    --cc=john.ogness@linutronix.de \
    --cc=linux-mm@kvack.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --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