From: Petr Mladek <pmladek@suse.com>
To: Tony Lindgren <tony.lindgren@linux.intel.com>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Jiri Slaby" <jirislaby@kernel.org>,
"Steven Rostedt" <rostedt@goodmis.org>,
"John Ogness" <john.ogness@linutronix.de>,
"Sergey Senozhatsky" <senozhatsky@chromium.org>,
"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
"Tony Lindgren" <tony@atomide.com>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] printk: Add update_preferred_console()
Date: Mon, 17 Jun 2024 10:03:14 +0200 [thread overview]
Message-ID: <Zm_tdcWDEQjQns_G@pathway.suse.cz> (raw)
In-Reply-To: <Zm_j2eq3QcaA-g-e@tlindgre-MOBL1>
On Mon 2024-06-17 10:20:57, Tony Lindgren wrote:
> On Fri, Jun 14, 2024 at 07:17:20PM +0200, Petr Mladek wrote:
> > On Thu 2024-06-13 15:51:08, Tony Lindgren wrote:
> > > The earlier attempt on doing this caused a regression with the kernel
> > > command line console order as it added calling __add_preferred_console()
> > > again later on during init. A better approach was suggested by Petr where
> > > we add the deferred console to the console_cmdline[] and update it later
> > > on when the console is ready.
> >
> > > --- a/kernel/printk/printk.c
> > > +++ b/kernel/printk/printk.c
> > > @@ -2486,8 +2495,8 @@ __setup("console_msg_format=", console_msg_format_setup);
> > > */
> > > static int __init console_setup(char *str)
> > > {
> > > - char buf[sizeof(console_cmdline[0].name) + 4]; /* 4 for "ttyS" */
> > > - char *s, *options, *brl_options = NULL;
> >
> > I would add
> >
> > static_assert(sizeof(console_cmdline[0].devname) >= sizeof(console_cmdline[0].name));
>
> That check should still be >= sizeof(console_cmdline[0].name) + 4, right?
> For the "number only" consoles we add the "ttyS" prefix.
Right. Great catch!
Best Regards,
Petr
prev parent reply other threads:[~2024-06-17 8:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-13 12:51 [PATCH v2 0/2] Fixes for console command line ordering Tony Lindgren
2024-06-13 12:51 ` [PATCH v2 1/2] printk: Revert add_preferred_console_match() related commits Tony Lindgren
2024-06-14 17:18 ` Petr Mladek
2024-06-13 12:51 ` [PATCH v2 2/2] printk: Add update_preferred_console() Tony Lindgren
2024-06-14 17:17 ` Petr Mladek
2024-06-17 7:20 ` Tony Lindgren
2024-06-17 8:03 ` 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=Zm_tdcWDEQjQns_G@pathway.suse.cz \
--to=pmladek@suse.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jirislaby@kernel.org \
--cc=john.ogness@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=senozhatsky@chromium.org \
--cc=tony.lindgren@linux.intel.com \
--cc=tony@atomide.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