POWERPC CPM_UART: got rid of extra status checks during RX
PATCH 1/1 POWERPC CPM_UART: got rid of extra status checks during RX
Status were verified in the cycle while exact variable is not updated in it. All "possibly bad" bits in status are relevant to the last received byte from buffer only. Also, more robust handling of overrun case.
Signed-off-by Vitaly Bordug <[email protected]>
---
drivers/serial/cpm_uart/cpm_uart_core.c | 14 ++++---------- 1 files changed, 4 insertions(+), 10 deletions(-)
drivers/serial/cpm_uart/cpm_uart_core.c +4 -10
@@ -299,8 +299,8 @@ static void cpm_uart_int_rx(struct uart_port *port) port->icount.rx++; flg =TTY_NORMAL ; -if (status & - (BD_SC_BR |BD_SC_FR |BD_SC_PR |BD_SC_OV )) +if (!i && status & + (BD_SC_BR |BD_SC_FR |BD_SC_PR |BD_SC_OV )) goto handle_error;if (uart_handle_sysrq_char (port, ch))continue ;
@@ -354,14 +354,8 @@ static void cpm_uart_int_rx(struct uart_port *port) flg =TTY_FRAME ;/* overrun does not affect the current character ! */ -if (status &BD_SC_OV ) { - ch =0 ; - flg =TTY_OVERRUN ; -/* We skip this buffer */ -/* CHECK: Is really nothing senseful there */ -/* ASSUMPTION: it contains nothing valid */ - i =0 ; - } +if (status &BD_SC_OV ) +tty_insert_flip_char (tty,0 ,TTY_OVERRUN );#ifdef SUPPORT_SYSRQ port->sysrq =0 ;#endif