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>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
755b6040fa
commit
8da636d9b5
@@ -2098,6 +2098,8 @@ static int ftdi_chars_in_buffer(struct tty_struct *tty)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
chars = usb_serial_generic_chars_in_buffer(tty);
|
chars = usb_serial_generic_chars_in_buffer(tty);
|
||||||
|
if (chars)
|
||||||
|
return chars;
|
||||||
|
|
||||||
/* Check hardware buffer */
|
/* Check hardware buffer */
|
||||||
switch (priv->chip_type) {
|
switch (priv->chip_type) {
|
||||||
|
Reference in New Issue
Block a user