Re: [PATCH v3] serial: uartps: Add TACTIVE bit in cdns_uart_tx_empty function

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

 



On 2020-01-31 12:04, Shubhrajyoti Datta wrote:
 drivers/tty/serial/xilinx_uartps.c | 22 +++++-----------------
 1 file changed, 5 insertions(+), 17 deletions(-)

diff --git a/drivers/tty/serial/xilinx_uartps.c
b/drivers/tty/serial/xilinx_uartps.c
index ed2f325..ebd0a74 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -656,8 +655,9 @@ static unsigned int cdns_uart_tx_empty(struct
uart_port *port)
 {
 	unsigned int status;

-	status = readl(port->membase + CDNS_UART_SR) &
-				CDNS_UART_SR_TXEMPTY;
+	status = ((readl(port->membase + CDNS_UART_SR) &
+				(CDNS_UART_SR_TXEMPTY |
+				CDNS_UART_SR_TACTIVE)) == CDNS_UART_SR_TXEMPTY);
 	return status ? TIOCSER_TEMT : 0;
 }

These lines look pretty incomprehensible.
How about rewriting it like this?

    status = readl(port->membase + CDNS_UART_SR) &
             (CDNS_UART_SR_TXEMPTY | CDNS_UART_SR_TACTIVE);
    return (status == CDNS_UART_SR_TXEMPTY) ? TIOCSER_TEMT : 0;

Maarten




[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