Explorar o código

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 <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Johan Hovold %!s(int64=13) %!d(string=hai) anos
pai
achega
8da636d9b5
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      drivers/usb/serial/ftdi_sio.c

+ 2 - 0
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) {