Re: [PATCH v5 09/14] serial: liteuart: fix rx loop variable types

From: Jiri Slaby
Date: Wed Nov 23 2022 - 00:39:51 EST


On 22. 11. 22, 22:05, Gabriel L. Somlo wrote:
So, looking at what uart_insert_char() does, I could simply do this
instead:

while(!litex_read8(membase + OFF_RXEMPTY) {
...
/* LiteUART does not provide overrun bits */
if (!(uart_handle_sysrq_char(port, ch) ||
tty_insert_flip_char(&port->state->port, ch, TTY_NORMAL)))
++port->icount.buf_overrun;
That is, `tty_insert_flip_char() is the portion of `uart_insert_char()`
that actually gets executed if status is 1 and overrun is 0...

I'm not quite confident about whether this is an improvement in legibility
and/or code quality,

It's not :). Keep the uart_ helper.

--
js
suse labs