Skip to content

Commit

Permalink
USB: ftdi_sio: optimise chars_in_buffer
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johan Hovold authored and Greg Kroah-Hartman committed Oct 30, 2012
1 parent 755b604 commit 8da636d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/usb/serial/ftdi_sio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 8da636d

Please sign in to comment.