lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YZzAmNUHOsrHh8su@alley>
Date:   Tue, 23 Nov 2021 11:21:12 +0100
From:   Petr Mladek <pmladek@...e.com>
To:     Sergey Senozhatsky <senozhatsky@...omium.org>
Cc:     John Ogness <john.ogness@...utronix.de>,
        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 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@...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().

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ