]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
arch: um: kmsg_dump: Use console_is_usable
authorMarcos Paulo de Souza <mpdesouza@suse.com>
Fri, 21 Nov 2025 18:50:34 +0000 (15:50 -0300)
committerPetr Mladek <pmladek@suse.com>
Thu, 27 Nov 2025 14:54:50 +0000 (15:54 +0100)
All consoles found on for_each_console are registered, meaning that all
of them have the CON_ENABLED flag set. Since NBCON was introduced it's
important to check if a given console also implements the NBCON callbacks.
The function console_is_usable does exactly that.

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-2-57b8b78647f4@suse.com
Signed-off-by: Petr Mladek <pmladek@suse.com>
arch/um/kernel/kmsg_dump.c

index 4190211752726593dd2847f66efd9d3a61cea982..fc0f543d1d8e35c9ce76f8379c6115e3955ae6c2 100644 (file)
@@ -31,7 +31,7 @@ static void kmsg_dumper_stdout(struct kmsg_dumper *dumper,
                 * expected to output the crash information.
                 */
                if (strcmp(con->name, "ttynull") != 0 &&
-                   (console_srcu_read_flags(con) & CON_ENABLED)) {
+                   console_is_usable(con, console_srcu_read_flags(con), true)) {
                        break;
                }
        }