[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200213090905.GB36551@google.com>
Date: Thu, 13 Feb 2020 18:09:05 +0900
From: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
To: Petr Mladek <pmladek@...e.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 2/3] printk: Fix preferred console selection with
multiple matches
On (20/02/13 09:39), Petr Mladek wrote:
> > > struct console_cmdline *c;
> > > int i;
> > > @@ -2131,6 +2131,8 @@ static int __add_preferred_console(char *name, int idx, char *options,
> > > if (strcmp(c->name, name) == 0 && c->index == idx) {
> > > if (!brl_options)
> > > preferred_console = i;
> > > + if (user_specified)
> > > + c->user_specified = true;
> > > return 0;
> > > }
> > > }
[..]
> > A silly question:
> >
> > Can the same console first be added by
> > console_setup()->__add_preferred_console(true)
> > and then by
> > add_preferred_console()->__add_preferred_console(false)
>
> I guess that this might happen. It should be safe because
> user_specified flag is set only to true when found again,
> see:
>
> if (user_specified)
> c->user_specified = true;
Yikes, I didn't see the if-condition. Yes, you are right.
-ss
Powered by blists - more mailing lists