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

tty/serial: Migrate sunsab 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: "David S. Miller" <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
Signed-off-by: Dmitry Safonov <dima@arista.com>
Link: https://lore.kernel.org/r/20191213000657.931618-47-dima@arista.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Dmitry Safonov and committed by
Greg Kroah-Hartman
cd8d7190 b071126b

+1 -4
+1 -4
drivers/tty/serial/sunsab.c
··· 40 40 #include <asm/prom.h> 41 41 #include <asm/setup.h> 42 42 43 - #if defined(CONFIG_SERIAL_SUNSAB_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 44 - #define SUPPORT_SYSRQ 45 - #endif 46 - 47 43 #include <linux/serial_core.h> 48 44 #include <linux/sunserialcore.h> 49 45 ··· 981 985 982 986 up->port.fifosize = SAB82532_XMIT_FIFO_SIZE; 983 987 up->port.iotype = UPIO_MEM; 988 + up->port.has_sysrq = IS_ENABLED(CONFIG_SERIAL_SUNSAB_CONSOLE); 984 989 985 990 writeb(SAB82532_IPC_IC_ACT_LOW, &up->regs->w.ipc); 986 991