lkml.org 
[lkml]   [2022]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    SubjectRe: [PATCH v5 09/14] serial: liteuart: fix rx loop variable types
    From
    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

    \
     
     \ /
      Last update: 2022-11-23 06:40    [W:2.787 / U:0.092 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site