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

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

authored by

Dmitry Safonov and committed by
Greg Kroah-Hartman
831cb968 5e637d2b

+1 -4
+1 -4
drivers/tty/serial/samsung_tty.c
··· 21 21 * BJD, 04-Nov-2004 22 22 */ 23 23 24 - #if defined(CONFIG_SERIAL_SAMSUNG_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 25 - #define SUPPORT_SYSRQ 26 - #endif 27 - 28 24 #include <linux/dmaengine.h> 29 25 #include <linux/dma-mapping.h> 30 26 #include <linux/slab.h> ··· 2008 2012 ourport->port.fifosize = ourport->drv_data->fifosize[index]; 2009 2013 else if (ourport->info->fifosize) 2010 2014 ourport->port.fifosize = ourport->info->fifosize; 2015 + ourport->port.has_sysrq = IS_ENABLED(CONFIG_SERIAL_SAMSUNG_CONSOLE); 2011 2016 2012 2017 /* 2013 2018 * DMA transfers must be aligned at least to cache line size,