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

From
Jiri Slaby <jirislaby@kernel.org>
Date
2022-11-23 05:39:51
Also in
lkml
Reply to
Gabriel L. Somlo, 2022-11-22
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
Thread (39 messages) 39 messages, 3 authors, last reply 2022-11-23
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help