[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6add0295e8790aef8df50d14b1bb607f5581687b.camel@kernel.crashing.org>
Date: Tue, 07 Jan 2020 11:50:42 +1100
From: Benjamin Herrenschmidt <benh@...nel.crashing.org>
To: Petr Mladek <pmladek@...e.com>,
Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
Cc: linux-kernel@...r.kernel.org,
Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Steven Rostedt <rostedt@...dmis.org>,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH v2] printk: Fix preferred console selection with
multiple matches
On Mon, 2020-01-06 at 11:25 +0100, Petr Mladek wrote:
>
> I agree that the enums are more self-descriptive. My problem with it is
> that there are 5 values. I wanted to check how they were handled
> and neither 'con_matched' nor 'con_failed' were later used.
>
> I though how to improve it. And I ended with feeling that the enum
> did more harm then good. -E??? codes are a bit less descriptive
> but there are only two. The meaning can be explained easily by
> a comment above the function.
>
> If you want to keep the enum then please handle the return values
> by switch(). Or make it clear that all possible return values
> are handled properly.
Agreed. The enum was originally due to me trying to figure out all the
different cases happening separately from how we react to them. In fact
I'm not even convinced we don't have bugs in the latter (the failure
path of Braille consoles is dubious).
In any case, I'm back now, I'll try to respin this week.
Cheers,
Ben.
Powered by blists - more mailing lists