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

8250_tegra: clean up tegra_uart_handle_break

* switch "do { A; } while (1)" to "while (1) { A; }"
* switch "if (A) B; else break;" to "if (!A) break; B;"
* remove unused assignment from p->serial_in() to status

Objdump -d shows no difference.

Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Jonathan Hunter <jonathanh@nvidia.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20210105120239.28031-6-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jiri Slaby and committed by
Greg Kroah-Hartman
7d7dec45 9bc1b2b9

+6 -5
+6 -5
drivers/tty/serial/8250/8250_tegra.c
··· 26 26 { 27 27 unsigned int status, tmout = 10000; 28 28 29 - do { 29 + while (1) { 30 30 status = p->serial_in(p, UART_LSR); 31 - if (status & (UART_LSR_FIFOE | UART_LSR_BRK_ERROR_BITS)) 32 - status = p->serial_in(p, UART_RX); 33 - else 31 + if (!(status & (UART_LSR_FIFOE | UART_LSR_BRK_ERROR_BITS))) 34 32 break; 33 + 34 + p->serial_in(p, UART_RX); 35 + 35 36 if (--tmout == 0) 36 37 break; 37 38 udelay(1); 38 - } while (1); 39 + } 39 40 } 40 41 41 42 static int tegra_uart_probe(struct platform_device *pdev)