]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
USB: serial: quatech2: drop redundant tty_buffer_request_room
authorJohan Hovold <johan@kernel.org>
Mon, 3 Apr 2017 09:58:55 +0000 (11:58 +0200)
committerJohan Hovold <johan@kernel.org>
Mon, 10 Apr 2017 07:42:00 +0000 (09:42 +0200)
Drop redundant calls to tty_buffer_request_room and use the more
efficient tty_insert_flip_char when inserting single characters.

Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/quatech2.c

index 6ddcaa2de90244baa562129aa49abd061442fc2e..60e17d1444c39fc50f4fbd85a579e967ba823775 100644 (file)
@@ -601,7 +601,6 @@ static void qt2_process_read_urb(struct urb *urb)
                                escapeflag = true;
                                break;
                        case QT2_CONTROL_ESCAPE:
-                               tty_buffer_request_room(&port->port, 2);
                                tty_insert_flip_string(&port->port, ch, 2);
                                i += 2;
                                escapeflag = true;
@@ -616,8 +615,7 @@ static void qt2_process_read_urb(struct urb *urb)
                                continue;
                }
 
-               tty_buffer_request_room(&port->port, 1);
-               tty_insert_flip_string(&port->port, ch, 1);
+               tty_insert_flip_char(&port->port, *ch, TTY_NORMAL);
        }
 
        tty_flip_buffer_push(&port->port);