Skip to content

Commit

Permalink
USB: serial: quatech2: drop redundant tty_buffer_request_room
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johan Hovold committed Apr 10, 2017
1 parent 7aac5e7 commit 185fcb3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/usb/serial/quatech2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit 185fcb3

Please sign in to comment.