[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200130131330.GY32742@smile.fi.intel.com>
Date: Thu, 30 Jan 2020 15:13:30 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Petr Mladek <pmladek@...e.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
Steven Rostedt <rostedt@...dmis.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 4/5] console: Avoid positive return code from
unregister_console()
On Thu, Jan 30, 2020 at 01:22:26PM +0100, Petr Mladek wrote:
> On Thu 2020-01-30 11:58:07, Andy Shevchenko wrote:
> > On Thu, Jan 30, 2020 at 10:04:29AM +0100, Petr Mladek wrote:
...
> > Okay, I understand that for time being it's matter of how eloquent
> > the commit message will be. (And maybe some comments in the code?)
> > Is it correct?
>
> Good question.
>
> Please, remove the last hunk if Sergey is not against it.
> I think that the success/error should not depend on the state
> of CON_ENABLED flag.
If I understood his last message correctly, he is exactly in favour of not
using it (and thus changing conditional for ->exit() callback to rely only
on res value).
> The other two changes might stay in the same patch. We just need
> to make the commit message easier to understand. I would write
> something like:
Thanks! Will do this way.
> <begin>
> There are only two callers that use the returned code from
> unregister_console():
>
> + unregister_early_console() in arch/m68k/kernel/early_printk.c
> + kgdb_unregister_nmi_console() in drivers/tty/serial/kgdb_nmi.c
>
> They both expect to get "0" on success and a non-zero value on error.
> But the current behavior is confusing and buggy:
>
> + _braille_unregister_console() returns "1" on success
> + unregister_console() returns "1" on error
>
> Fix and clean up the behavior:
>
> + Return success when _braille_unregister_console() succeeded.
> + Return a meaningful error code when the console was not
> registered before.
> </end>
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists