Re: [PATCH v5 04/16] printk: Separate code for adding/updating preferred console metadata

From: Petr Mladek

Date: Tue Nov 03 2026 - 12:09:27 EST


On Thu 2026-10-29 15:05:49, Chris Down wrote:
> Petr Mladek writes:
> >The logic for adding or updating a preferred console is currently
> >duplicated within __add_preferred_console(), making the code difficult
> >to follow and prone to consistency issues.
>
> I checked that the split itself has no functional change. Thanks!
>
> >-}
> >-
> >-static int __add_preferred_console(const char *name, const short idx,
> >- const char *devname, char *options,
> >- char *brl_options, bool user_specified)
> >+/** add_or_update_preferred_console - Add or update a given entry in
> >+ * the preferred_consoles[] array.
> >+ * @i: index of the entry in @preferred_consoles table which should get updated.
>
> kernel-doc needs "/**" on its own line, otherwise it silently skips the whole
> block (`scripts/kernel-doc -none -Wall` reports nothing for this function right
> now). With that fixed, -Wall then also wants a "Return:" section.
> "@preferred_consoles" also reads as a parameter, maybe just
> "preferred_consoles[]".

Good to know. I was not aware of it. Will fix in v6.

> I agree with John about keeping the comments explaining user_specified and
> console_set_on_cmdline as well.

Done.

Best Regards,
Petr