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

tty/serial: Migrate dz 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: "Maciej W. Rozycki" <macro@linux-mips.org>
Signed-off-by: Dmitry Safonov <dima@arista.com>
Link: https://lore.kernel.org/r/20191213000657.931618-16-dima@arista.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Dmitry Safonov and committed by
Greg Kroah-Hartman
881bdb44 410090d2

+1 -4
+1 -4
drivers/tty/serial/dz.c
··· 29 29 30 30 #undef DEBUG_DZ 31 31 32 - #if defined(CONFIG_SERIAL_DZ_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 33 - #define SUPPORT_SYSRQ 34 - #endif 35 - 36 32 #include <linux/bitops.h> 37 33 #include <linux/compiler.h> 38 34 #include <linux/console.h> ··· 783 787 uport->ops = &dz_ops; 784 788 uport->line = line; 785 789 uport->mapbase = base; 790 + uport->has_sysrq = IS_ENABLED(CONFIG_SERIAL_DZ_CONSOLE); 786 791 } 787 792 } 788 793