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

mxser: simplify condition in mxser_receive_chars_new

mxser_receive_chars_old() is used whenever MOXA_MUST_LSR_RERR is set in
status no matter the HW ID (the last 'if'). So there is no need for
another check of MOXA_MUST_LSR_RERR _with_ hwid == MOXA_MUST_MU860_HWID
(the third 'if'). Hence remove this subcase. That allows us to check
status on a single line with both UART_LSR_BRK_ERROR_BITS (from the
second 'if') and MOXA_MUST_LSR_RERR (the last 'if').

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20210922075938.31390-2-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jiri Slaby and committed by
Greg Kroah-Hartman
7d5006d5 3fdfa165

+1 -5
+1 -5
drivers/tty/mxser.c
··· 1550 1550 1551 1551 if (hwid == MOXA_OTHER_UART) 1552 1552 return false; 1553 - if (status & UART_LSR_BRK_ERROR_BITS) 1554 - return false; 1555 - if (hwid == MOXA_MUST_MU860_HWID && (status & MOXA_MUST_LSR_RERR)) 1556 - return false; 1557 - if (status & MOXA_MUST_LSR_RERR) 1553 + if (status & (UART_LSR_BRK_ERROR_BITS | MOXA_MUST_LSR_RERR)) 1558 1554 return false; 1559 1555 1560 1556 gdl = inb(port->ioaddr + MOXA_MUST_GDL_REGISTER);