diff options
author | Gabriel Somlo <gsomlo@gmail.com> | 2022-11-23 14:04:55 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-01-19 14:59:40 +0100 |
commit | a774aa4580d4339a37e4810f303b6a39ddc745ea (patch) | |
tree | 4f537f2ae3e27ab397e86732f211b64c3a86e940 /drivers/tty/serial/liteuart.c | |
parent | serial: liteuart: simplify passing of uart_insert_char() flag (diff) | |
download | linux-a774aa4580d4339a37e4810f303b6a39ddc745ea.tar.xz linux-a774aa4580d4339a37e4810f303b6a39ddc745ea.zip |
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: Gabriel Somlo <gsomlo@gmail.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20221123130500.1030189-10-gsomlo@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/liteuart.c')
-rw-r--r-- | drivers/tty/serial/liteuart.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/tty/serial/liteuart.c b/drivers/tty/serial/liteuart.c index 81aa7c1da73c..62bfd2ed9051 100644 --- a/drivers/tty/serial/liteuart.c +++ b/drivers/tty/serial/liteuart.c @@ -73,10 +73,9 @@ static void liteuart_timer(struct timer_list *t) struct liteuart_port *uart = from_timer(uart, t, timer); struct uart_port *port = &uart->port; unsigned char __iomem *membase = port->membase; - int ch; - unsigned long status; + u8 ch; - while ((status = !litex_read8(membase + OFF_RXEMPTY)) == 1) { + while (!litex_read8(membase + OFF_RXEMPTY)) { ch = litex_read8(membase + OFF_RXTX); port->icount.rx++; @@ -85,7 +84,7 @@ 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, TTY_NORMAL); + uart_insert_char(port, 1, 0, ch, TTY_NORMAL); } tty_flip_buffer_push(&port->state->port); |