[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YZxNiiK3PRZnsfPG@google.com>
Date: Tue, 23 Nov 2021 11:10:18 +0900
From: Sergey Senozhatsky <senozhatsky@...omium.org>
To: Petr Mladek <pmladek@...e.com>
Cc: John Ogness <john.ogness@...utronix.de>,
Sergey Senozhatsky <senozhatsky@...omium.org>,
Steven Rostedt <rostedt@...dmis.org>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/5] printk/console: Split out code that enables default
console
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@...e.com>
Reviewed-by: Sergey Senozhatsky <senozhatsky@...omium.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().
Powered by blists - more mailing lists