]> Gentwo Git Trees - linux/.git/commit
drivers: serial: kgdboc: Drop checks for CON_ENABLED and CON_BOOT
authorMarcos Paulo de Souza <mpdesouza@suse.com>
Fri, 21 Nov 2025 18:50:33 +0000 (15:50 -0300)
committerPetr Mladek <pmladek@suse.com>
Thu, 27 Nov 2025 14:54:50 +0000 (15:54 +0100)
commit822e2bb0d6dd792b95da2d4f420eb3dac5af95a7
treee2936f2bab69f5060f3715edcda77fe3f49527f3
parent62627bf0cadf6eae87d92fecf604c42160fe16ef
drivers: serial: kgdboc: Drop checks for CON_ENABLED and CON_BOOT

The original code tried to find a console that has CON_BOOT _or_
CON_ENABLED flag set. The flag CON_ENABLED is set to all registered
consoles, so in this case this check is always true, even for the
CON_BOOT consoles.

The initial intent of the kgdboc_earlycon_init was to get a console
early (CON_BOOT) or later on in the process (CON_ENABLED). The
code was using for_each_console macro, meaning that all console structs
were previously registered on the printk() machinery. At this point,
any console found on for_each_console is safe for kgdboc_earlycon_init
to use.

Dropping the check makes the code cleaner, and avoids further confusion
by future readers of the code.

Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Link: https://patch.msgid.link/20251121-printk-cleanup-part2-v2-1-57b8b78647f4@suse.com
Signed-off-by: Petr Mladek <pmladek@suse.com>
drivers/tty/serial/kgdboc.c