Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

proc: Add nbcon support for /proc/consoles

Update /proc/consoles output to show 'W' if an nbcon console is
registered. Since the write_thread() callback is mandatory, it
enough just to check if it is an nbcon console.

Also update /proc/consoles output to show 'N' if it is an
nbcon console.

Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20240904120536.115780-14-john.ogness@linutronix.de
Signed-off-by: Petr Mladek <pmladek@suse.com>

authored by

John Ogness and committed by
Petr Mladek
c83a2066 fe6fa88d

+3 -2
+3 -2
fs/proc/consoles.c
··· 21 21 { CON_ENABLED, 'E' }, 22 22 { CON_CONSDEV, 'C' }, 23 23 { CON_BOOT, 'B' }, 24 + { CON_NBCON, 'N' }, 24 25 { CON_PRINTBUFFER, 'p' }, 25 26 { CON_BRL, 'b' }, 26 27 { CON_ANYTIME, 'a' }, ··· 59 58 seq_printf(m, "%s%d", con->name, con->index); 60 59 seq_pad(m, ' '); 61 60 seq_printf(m, "%c%c%c (%s)", con->read ? 'R' : '-', 62 - con->write ? 'W' : '-', con->unblank ? 'U' : '-', 63 - flags); 61 + ((con->flags & CON_NBCON) || con->write) ? 'W' : '-', 62 + con->unblank ? 'U' : '-', flags); 64 63 if (dev) 65 64 seq_printf(m, " %4d:%d", MAJOR(dev), MINOR(dev)); 66 65