[PATCH 3/5] serial: xuartps: Removed unwanted checks while reading the error conditions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Nava kishore Manne <nava.manne@xxxxxxxxxx>

This patch Remove the unwated checks while reading the parity,framing,
overrun and Break detection errors.

Signed-off-by: Nava kishore Manne <navam@xxxxxxxxxx>
Signed-off-by: Michal Simek <michal.simek@xxxxxxxxxx>
[stelford@xxxxxxxxxxx: cherry picked from
https://github.com/Xilinx/linux-xlnx commit
b1cf74970df5470ffbc8e7876a9edf5e3498ef94]
Signed-off-by: Scott Telford <stelford@xxxxxxxxxxx>
---
 drivers/tty/serial/xilinx_uartps.c | 50 ++++++++++++++++++--------------------
 1 file changed, 24 insertions(+), 26 deletions(-)

diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index 2df4d3a..cde04eb 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -266,35 +266,33 @@ static void cdns_uart_handle_rx(void *dev_id, unsigned int isrstatus)
 		isrstatus &= port->read_status_mask;
 		isrstatus &= ~port->ignore_status_mask;
 
-		if ((isrstatus & CDNS_UART_IXR_TOUT) ||
-		    (isrstatus & CDNS_UART_IXR_RXTRIG)) {
-			if (data &&
-			    (port->read_status_mask & CDNS_UART_IXR_BRK)) {
-				port->read_status_mask &= ~CDNS_UART_IXR_BRK;
-				port->icount.brk++;
-				if (uart_handle_break(port))
-					continue;
-			}
-
-			if (uart_handle_sysrq_char(port, data))
+		if (data &&
+		    (port->read_status_mask & CDNS_UART_IXR_BRK)) {
+			port->read_status_mask &= ~CDNS_UART_IXR_BRK;
+			port->icount.brk++;
+			if (uart_handle_break(port))
 				continue;
+		}
 
-			if (isrstatus & CDNS_UART_IXR_PARITY) {
-				port->icount.parity++;
-				status = TTY_PARITY;
-			}
-			if ((isrstatus & CDNS_UART_IXR_FRAMING) &&
-			    !framerrprocessed) {
-				port->icount.frame++;
-				status = TTY_FRAME;
-			}
-			if (isrstatus & CDNS_UART_IXR_OVERRUN) {
-				port->icount.overrun++;
-				tty_insert_flip_char(&port->state->port, 0,
-						     TTY_OVERRUN);
-			}
-			tty_insert_flip_char(&port->state->port, data, status);
+		if (uart_handle_sysrq_char(port, data))
+			continue;
+
+		if (isrstatus & CDNS_UART_IXR_PARITY) {
+			port->icount.parity++;
+			status = TTY_PARITY;
+		}
+		if ((isrstatus & CDNS_UART_IXR_FRAMING) &&
+		    !framerrprocessed) {
+			port->icount.frame++;
+			status = TTY_FRAME;
+		}
+		if (isrstatus & CDNS_UART_IXR_OVERRUN) {
+			port->icount.overrun++;
+			tty_insert_flip_char(&port->state->port, 0,
+					     TTY_OVERRUN);
 		}
+		tty_insert_flip_char(&port->state->port, data, status);
+		isrstatus = 0;
 	}
 	spin_unlock(&port->lock);
 	tty_flip_buffer_push(&port->state->port);
-- 
2.2.2

--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux