Re: [PATCH 08/10] serial: arc_uart: simplify flags handling in arc_serial_rx_chars()

From: Vineet Gupta
Date: Wed Jul 12 2023 - 21:05:34 EST




On 7/12/23 01:18, Jiri Slaby (SUSE) wrote:
* move the declaration of flg (with the initializer) to the loop, so
there is no need to reset it to TTY_NORMAL by an 'else' branch.
* use TTY_NORMAL as initializer above, not a magic zero constant
* remove the outer 'if' from this construct:
if (S & (A | B)) {
if (S & A)
X;
if (S & B)
Y;
}
* drop unlikely() as I doubt it has any benefits here. If it does,
provide numbers.

All four make the code easier to read.

Signed-off-by: Jiri Slaby (SUSE)<jirislaby@xxxxxxxxxx>
Cc: Vineet Gupta<vgupta@xxxxxxxxxx>

Thanks for the cleanup.

Acked-by: Vineet Gupta <vgupta@xxxxxxxxxx>

Th,
-Vineet