Re: [PATCH v2 1/9] printk: Rename struct console_cmdline to preferred_console

From: Steven Rostedt

Date: Thu Apr 23 2026 - 10:20:41 EST


On Thu, 23 Apr 2026 15:00:06 +0200
Petr Mladek <pmladek@xxxxxxxx> wrote:

> The structure 'console_cmdline' was originally intended to store details
> about consoles defined on the kernel command line. However, its usage
> has since expanded; it now stores information for consoles preferred
> via SPCR, device tree, or by particular platforms, e.g. XEN.
>
> The current naming is misleading as it implies the configuration only
> originates from the command line.
>
> Rename the structure and associated artifacts to better reflect their
> current purpose, for example:
>
> - struct console_cmdline c -> struct preferred_console pc
> - console_cmdline[] -> preferred_consoles[]
> - console_cmdline.h -> console_register.h
> - c -> pc

Nice.

>
> Additionally, renaming the header file to console_register.h would
> eventually allow to decouple console registration logic from
> the monolithic printk.c.
>
> Finally, renaming the local variable from "c" to "pc" helps to distinguish
> it from struct console variables. Note that "c" is used for struct console
> in some code, for example see vt_console_device() function definition.
>
> The patch should not change the existing behaivor.

I believe the phrase is: "No functional changes" ;-)

>
> Signed-off-by: Petr Mladek <pmladek@xxxxxxxx>
> Acked-by: Chris Down <chris@xxxxxxxxxxxxxx>
> Acked-by: Marcos Paulo de Souza <mpdesouza@xxxxxxxx>
> ---


> @@ -2624,8 +2624,10 @@ __setup("console_msg_format=", console_msg_format_setup);
> */
> static int __init console_setup(char *str)
> {
> - static_assert(sizeof(console_cmdline[0].devname) >= sizeof(console_cmdline[0].name) + 4);
> - char buf[sizeof(console_cmdline[0].devname)];
> + static_assert(sizeof(preferred_consoles[0].devname) >=
> + sizeof(preferred_consoles[0].name) + 4);

Hmm with the line break and you adding a space before the declarations; If
this is going to change, might as well move it below the declarations as it
is a compile time check, and the order doesn't matter.

> +
> + char buf[sizeof(preferred_consoles[0].devname)];
> char *brl_options = NULL;
> char *ttyname = NULL;
> char *devname = NULL;

-- Steve