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

tty/serial: Migrate arc_uart 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.

Cc: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Dmitry Safonov <dima@arista.com>
Link: https://lore.kernel.org/r/20191213000657.931618-12-dima@arista.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Dmitry Safonov and committed by
Greg Kroah-Hartman
933505e9 3db3cca6

+1 -4
+1 -4
drivers/tty/serial/arc_uart.c
··· 21 21 * -check if sysreq works 22 22 */ 23 23 24 - #if defined(CONFIG_SERIAL_ARC_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 25 - #define SUPPORT_SYSRQ 26 - #endif 27 - 28 24 #include <linux/module.h> 29 25 #include <linux/serial.h> 30 26 #include <linux/console.h> ··· 621 625 port->flags = UPF_BOOT_AUTOCONF; 622 626 port->line = dev_id; 623 627 port->ops = &arc_serial_pops; 628 + port->has_sysrq = IS_ENABLED(CONFIG_SERIAL_ARC_CONSOLE); 624 629 625 630 port->fifosize = ARC_UART_TX_FIFO_SIZE; 626 631