summaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/generic.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2020-07-08 14:49:56 +0200
committerJohan Hovold <johan@kernel.org>2020-07-09 09:20:06 +0200
commit4fbfbdb5726ff15bdce1c371efa1281b28322f64 (patch)
treea0c36c4a106929f4b9d5604f247d46e6a718691a /drivers/usb/serial/generic.c
parentUSB: serial: only process sysrq when enabled (diff)
downloadlinux-4fbfbdb5726ff15bdce1c371efa1281b28322f64.tar.xz
linux-4fbfbdb5726ff15bdce1c371efa1281b28322f64.zip
USB: serial: inline sysrq dummy function
Inline the dummy sysrq character handling when either console support or magic-sysrq support isn't enabled to allow the compiler to eliminate unused code. Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb/serial/generic.c')
-rw-r--r--drivers/usb/serial/generic.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index c5b35252c931..a9b6d103aaf6 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -571,7 +571,7 @@ int usb_serial_generic_get_icount(struct tty_struct *tty,
}
EXPORT_SYMBOL_GPL(usb_serial_generic_get_icount);
-#ifdef CONFIG_MAGIC_SYSRQ
+#if defined(CONFIG_USB_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
int usb_serial_handle_sysrq_char(struct usb_serial_port *port, unsigned int ch)
{
if (port->sysrq) {
@@ -584,13 +584,8 @@ int usb_serial_handle_sysrq_char(struct usb_serial_port *port, unsigned int ch)
}
return 0;
}
-#else
-int usb_serial_handle_sysrq_char(struct usb_serial_port *port, unsigned int ch)
-{
- return 0;
-}
-#endif
EXPORT_SYMBOL_GPL(usb_serial_handle_sysrq_char);
+#endif
int usb_serial_handle_break(struct usb_serial_port *port)
{