Commit a774aa45 authored by Gabriel Somlo's avatar Gabriel Somlo Committed by Greg Kroah-Hartman

serial: liteuart: clean up rx loop variables

The `status` variable will always be `1` when passed into the call
to `uart_insert_char()`, so it can be eliminated altogether.

Use `u8` as the type for `ch`, as it matches the return type of
the `litex_read8()` call which produces its value.
Signed-off-by: default avatarGabriel Somlo <gsomlo@gmail.com>
Reviewed-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: default avatarJiri Slaby <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20221123130500.1030189-10-gsomlo@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ca538cc7
...@@ -73,10 +73,9 @@ static void liteuart_timer(struct timer_list *t) ...@@ -73,10 +73,9 @@ static void liteuart_timer(struct timer_list *t)
struct liteuart_port *uart = from_timer(uart, t, timer); struct liteuart_port *uart = from_timer(uart, t, timer);
struct uart_port *port = &uart->port; struct uart_port *port = &uart->port;
unsigned char __iomem *membase = port->membase; unsigned char __iomem *membase = port->membase;
int ch; u8 ch;
unsigned long status;
while ((status = !litex_read8(membase + OFF_RXEMPTY)) == 1) { while (!litex_read8(membase + OFF_RXEMPTY)) {
ch = litex_read8(membase + OFF_RXTX); ch = litex_read8(membase + OFF_RXTX);
port->icount.rx++; port->icount.rx++;
...@@ -85,7 +84,7 @@ static void liteuart_timer(struct timer_list *t) ...@@ -85,7 +84,7 @@ static void liteuart_timer(struct timer_list *t)
/* no overflow bits in status */ /* no overflow bits in status */
if (!(uart_handle_sysrq_char(port, ch))) if (!(uart_handle_sysrq_char(port, ch)))
uart_insert_char(port, status, 0, ch, TTY_NORMAL); uart_insert_char(port, 1, 0, ch, TTY_NORMAL);
} }
tty_flip_buffer_push(&port->state->port); tty_flip_buffer_push(&port->state->port);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment