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

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Gabriel Somlo and committed by
Greg Kroah-Hartman
a774aa45 ca538cc7

+3 -4
+3 -4
drivers/tty/serial/liteuart.c
··· 73 73 struct liteuart_port *uart = from_timer(uart, t, timer); 74 74 struct uart_port *port = &uart->port; 75 75 unsigned char __iomem *membase = port->membase; 76 - int ch; 77 - unsigned long status; 76 + u8 ch; 78 77 79 - while ((status = !litex_read8(membase + OFF_RXEMPTY)) == 1) { 78 + while (!litex_read8(membase + OFF_RXEMPTY)) { 80 79 ch = litex_read8(membase + OFF_RXTX); 81 80 port->icount.rx++; 82 81 ··· 84 85 85 86 /* no overflow bits in status */ 86 87 if (!(uart_handle_sysrq_char(port, ch))) 87 - uart_insert_char(port, status, 0, ch, TTY_NORMAL); 88 + uart_insert_char(port, 1, 0, ch, TTY_NORMAL); 88 89 } 89 90 90 91 tty_flip_buffer_push(&port->state->port);