[PATCH 55/58] usb/serial: Don't handle break when CONFIG_MAGIC_SYSRQ is disabled

Dmitry Safonov
2019-12-13T00:10:02Z

While at it, remove ifdeffery around usb_serial_handle_sysrq_char() as
it doesn't save much from .text anyway.

Cc: Johan Hovold <johan@kernel.org>
Signed-off-by: Dmitry Safonov <dima@arista.com>
---
drivers/usb/serial/generic.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index 1be8bea372a2..37361031402e 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -571,7 +571,6 @@ int usb_serial_generic_get_icount(struct tty_struct *tty,
}
EXPORT_SYMBOL_GPL(usb_serial_generic_get_icount);

-#ifdef CONFIG_MAGIC_SYSRQ
int usb_serial_handle_sysrq_char(struct usb_serial_port *port, unsigned int ch)
{
if (port->sysrq && port->port.console) {
@@ -584,16 +583,13 @@ 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);

int usb_serial_handle_break(struct usb_serial_port *port)
{
+ if (!IS_ENABLED(CONFIG_MAGIC_SYSRQ))
+ return 0;
+
if (!port->sysrq) {
port->sysrq = jiffies + HZ*5;
return 1;
--
2.24.0