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

From: Chris Down

Date: Thu Oct 29 2026 - 03:06:04 EST


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[]".

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

With the kernel-doc comment fixed:

Acked-by: Chris Down <chris@xxxxxxxxxxxxxx>