Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: serial: quatech2: drop redundant tty_buffer_request_room

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>

+1 -3
+1 -3
drivers/usb/serial/quatech2.c
··· 601 601 escapeflag = true; 602 602 break; 603 603 case QT2_CONTROL_ESCAPE: 604 - tty_buffer_request_room(&port->port, 2); 605 604 tty_insert_flip_string(&port->port, ch, 2); 606 605 i += 2; 607 606 escapeflag = true; ··· 615 616 continue; 616 617 } 617 618 618 - tty_buffer_request_room(&port->port, 1); 619 - tty_insert_flip_string(&port->port, ch, 1); 619 + tty_insert_flip_char(&port->port, *ch, TTY_NORMAL); 620 620 } 621 621 622 622 tty_flip_buffer_push(&port->port);