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

tty/serial: Migrate sunhv 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-46-dima@arista.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Dmitry Safonov and committed by
Greg Kroah-Hartman
b071126b 9feedaa7

+1 -4
+1 -4
drivers/tty/serial/sunhv.c
··· 25 25 #include <asm/irq.h> 26 26 #include <asm/setup.h> 27 27 28 - #if defined(CONFIG_MAGIC_SYSRQ) 29 - #define SUPPORT_SYSRQ 30 - #endif 31 - 32 28 #include <linux/serial_core.h> 33 29 #include <linux/sunserialcore.h> 34 30 ··· 548 552 549 553 sunhv_port = port; 550 554 555 + port->has_sysrq = 1; 551 556 port->line = 0; 552 557 port->ops = &sunhv_pops; 553 558 port->type = PORT_SUNHV;