All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: Petr Mladek <pmladek@suse.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 2/3] printk: Fix preferred console selection with multiple matches
Date: Thu, 13 Feb 2020 18:09:05 +0900	[thread overview]
Message-ID: <20200213090905.GB36551@google.com> (raw)
In-Reply-To: <20200213083942.6ue3ehaaycourgfi@pathway.suse.cz>

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

      reply	other threads:[~2020-02-13  9:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-06  4:02 [PATCH v3 2/3] printk: Fix preferred console selection with multiple matches Benjamin Herrenschmidt
2020-02-11 14:41 ` Petr Mladek
2020-02-11 15:33   ` Benjamin Herrenschmidt
2020-02-13  5:52 ` Sergey Senozhatsky
2020-02-13  8:39   ` Petr Mladek
2020-02-13  9:09     ` Sergey Senozhatsky [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=20200213090905.GB36551@google.com \
    --to=sergey.senozhatsky.work@gmail.com \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmladek@suse.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.