From: Johan Hovold Date: Wed, 8 Jul 2020 12:49:55 +0000 (+0200) Subject: USB: serial: only process sysrq when enabled X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=8c6a223186a6c3fe7cd381ef7e1d60ea6fd8fd52;p=linux.git USB: serial: only process sysrq when enabled Do not set the sysrq timestamp unless CONFIG_MAGIC_SYSRQ is enabled to avoid unnecessary per-character processing for consoles. Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold --- diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c index 05a2a3aa39636..c5b35252c931a 100644 --- a/drivers/usb/serial/generic.c +++ b/drivers/usb/serial/generic.c @@ -594,7 +594,7 @@ EXPORT_SYMBOL_GPL(usb_serial_handle_sysrq_char); int usb_serial_handle_break(struct usb_serial_port *port) { - if (!port->port.console) + if (!port->port.console || !IS_ENABLED(CONFIG_MAGIC_SYSRQ)) return 0; if (!port->sysrq) {