diff options
author | Johan Hovold <johan@kernel.org> | 2020-07-08 15:49:56 +0300 |
---|---|---|
committer | Johan Hovold <johan@kernel.org> | 2020-07-09 10:20:06 +0300 |
commit | 4fbfbdb5726ff15bdce1c371efa1281b28322f64 (patch) | |
tree | a0c36c4a106929f4b9d5604f247d46e6a718691a /include/linux/usb | |
parent | 8c6a223186a6c3fe7cd381ef7e1d60ea6fd8fd52 (diff) | |
download | linux-4fbfbdb5726ff15bdce1c371efa1281b28322f64.tar.xz |
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 'include/linux/usb')
-rw-r--r-- | include/linux/usb/serial.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 14cac4a1ae8f..be73646706a9 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h @@ -365,8 +365,17 @@ extern int usb_serial_generic_submit_read_urbs(struct usb_serial_port *port, extern void usb_serial_generic_process_read_urb(struct urb *urb); extern int usb_serial_generic_prepare_write_buffer(struct usb_serial_port *port, void *dest, size_t size); + +#if defined(CONFIG_USB_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) extern int usb_serial_handle_sysrq_char(struct usb_serial_port *port, unsigned int ch); +#else +static inline int usb_serial_handle_sysrq_char(struct usb_serial_port *port, unsigned int ch) +{ + return 0; +} +#endif + extern int usb_serial_handle_break(struct usb_serial_port *port); extern void usb_serial_handle_dcd_change(struct usb_serial_port *usb_port, struct tty_struct *tty, |