serial: liteuart: move tty_flip_buffer_push() out of rx loop
authorGabriel Somlo <gsomlo@gmail.com>
Wed, 23 Nov 2022 13:04:52 +0000 (08:04 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Jan 2023 13:59:40 +0000 (14:59 +0100)
Calling tty_flip_buffer_push() for each individual received character
is overkill. Move it out of the rx loop, and only call it once per
set of characters received together.

Signed-off-by: Gabriel Somlo <gsomlo@gmail.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20221123130500.1030189-7-gsomlo@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/liteuart.c

index 1e3429bcc2adf2b37fedd3eb7cb6139fb6f68a87..81a86c5eb3937720eb2aa14f1839432017cdf033 100644 (file)
@@ -87,10 +87,10 @@ static void liteuart_timer(struct timer_list *t)
                /* no overflow bits in status */
                if (!(uart_handle_sysrq_char(port, ch)))
                        uart_insert_char(port, status, 0, ch, flg);
-
-               tty_flip_buffer_push(&port->state->port);
        }
 
+       tty_flip_buffer_push(&port->state->port);
+
        mod_timer(&uart->timer, jiffies + uart_poll_timeout(port));
 }