LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: John Ogness <john.ogness@linutronix.de>,
Steven Rostedt <rostedt@goodmis.org>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/5] printk/console: Split out code that enables default console
Date: Tue, 23 Nov 2021 11:21:12 +0100 [thread overview]
Message-ID: <YZzAmNUHOsrHh8su@alley> (raw)
In-Reply-To: <YZxNiiK3PRZnsfPG@google.com>
On Tue 2021-11-23 11:10:18, Sergey Senozhatsky wrote:
> On (21/11/22 14:26), Petr Mladek wrote:
> > Put the code enabling a console by default into a separate function
> > called try_enable_default_console().
> >
> > Rename try_enable_new_console() to try_enable_preferred_console() to
> > make the purpose of the different variants more clear.
> >
> > It is a code refactoring without any functional change.
> >
> > Signed-off-by: Petr Mladek <pmladek@suse.com>
>
> Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
>
> [..]
> > -static int try_enable_new_console(struct console *newcon, bool user_specified)
> > +static int try_enable_preferred_console(struct console *newcon,
> > + bool user_specified)
> > {
> > struct console_cmdline *c;
> > int i, err;
> > @@ -2909,6 +2910,23 @@ static int try_enable_new_console(struct console *newcon, bool user_specified)
> > return -ENOENT;
> > }
> >
> > +/* Try to enable the console unconditionally */
> > +static void try_enable_default_console(struct console *newcon)
> > +{
> > + if (newcon->index < 0)
> > + newcon->index = 0;
> > +
> > + if (newcon->setup && newcon->setup(newcon, NULL) != 0)
> > + return;
> > +
> > + newcon->flags |= CON_ENABLED;
> > +
> > + if (newcon->device) {
> > + newcon->flags |= CON_CONSDEV;
> > + has_preferred_console = true;
> > + }
> > +}
>
> try_enable_default_console() also sets preferred_console, as well as
> try_enable_preferred_console().
Yes, this is one of the confusing things that this patchset is trying to solve.
The result of this patchset is that preferred_console will be used
only for consoles that are explicitely preferred via the command line,
device tree, or SPCR.
The variable @has_preferred_console is renamed to @need_default_console
in 2nd patch and completely removed in 4th patch.
Anyway, thanks for review.
Best Regards,
Petr
next prev parent reply other threads:[~2021-11-23 10:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-22 13:26 [PATCH 0/5] printk/console: Registration code cleanup - part 1 Petr Mladek
2021-11-22 13:26 ` [PATCH 1/5] printk/console: Split out code that enables default console Petr Mladek
2021-11-23 2:10 ` Sergey Senozhatsky
2021-11-23 10:21 ` Petr Mladek [this message]
2021-11-22 13:26 ` [PATCH 2/5] printk/console: Rename has_preferred_console to need_default_console Petr Mladek
2021-11-23 2:15 ` Sergey Senozhatsky
2021-11-23 10:51 ` Petr Mladek
2021-11-22 13:26 ` [PATCH 3/5] printk/console: Remove unnecessary need_default_console manipulation Petr Mladek
2021-11-22 13:26 ` [PATCH 4/5] printk/console: Remove need_default_console variable Petr Mladek
2021-11-22 13:26 ` [PATCH 5/5] printk/console: Clean up boot console handling in register_console() Petr Mladek
2021-12-06 13:54 ` [PATCH 0/5] printk/console: Registration code cleanup - part 1 Petr Mladek
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=YZzAmNUHOsrHh8su@alley \
--to=pmladek@suse.com \
--cc=benh@kernel.crashing.org \
--cc=john.ogness@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=senozhatsky@chromium.org \
--subject='Re: [PATCH 1/5] printk/console: Split out code that enables default console' \
/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
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).