From 8da636d9b5f3af354458f5b7eadaf51f23017fdc Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Mon, 29 Oct 2012 10:56:27 +0100 Subject: [PATCH] USB: ftdi_sio: optimise chars_in_buffer No need to check hardware buffers when we know that the software buffers are non-empty. Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/ftdi_sio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 9fe3a2e965ad..b8bc9d0cb127 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -2098,6 +2098,8 @@ static int ftdi_chars_in_buffer(struct tty_struct *tty) int ret; chars = usb_serial_generic_chars_in_buffer(tty); + if (chars) + return chars; /* Check hardware buffer */ switch (priv->chip_type) { -- 2.20.1