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

tty/serial: Migrate mux to use has_sysrq

The SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between
different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)

In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added.
Initialise it in driver's probe and remove ifdeffery.

Signed-off-by: Dmitry Safonov <dima@arista.com>
Link: https://lore.kernel.org/r/20191213000657.931618-27-dima@arista.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Dmitry Safonov and committed by
Greg Kroah-Hartman
b4088e83 804ca1df

+1 -4
+1 -4
drivers/tty/serial/mux.c
··· 25 25 #include <asm/irq.h> 26 26 #include <asm/parisc-device.h> 27 27 28 - #if defined(CONFIG_SERIAL_MUX_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 29 28 #include <linux/sysrq.h> 30 - #define SUPPORT_SYSRQ 31 - #endif 32 - 33 29 #include <linux/serial_core.h> 34 30 35 31 #define MUX_OFFSET 0x800 ··· 479 483 port->ops = &mux_pops; 480 484 port->flags = UPF_BOOT_AUTOCONF; 481 485 port->line = port_cnt; 486 + port->has_sysrq = IS_ENABLED(CONFIG_SERIAL_MUX_CONSOLE); 482 487 483 488 /* The port->timeout needs to match what is present in 484 489 * uart_wait_until_sent in serial_core.c. Otherwise