[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <44b8cf91d3d2f20a81e0215b1b2fc7a8@vanmierlo.com>
Date: Sat, 01 Feb 2020 12:29:15 +0100
From: Maarten Brock <m.brock@...mierlo.com>
To: Shubhrajyoti Datta <shubhrajyoti.datta@...inx.com>
Cc: linux-serial@...r.kernel.org, gregkh@...uxfoundation.org,
jslaby@...e.com, michal.simek@...inx.com,
linux-kernel@...r.kernel.org,
Raviteja Narayanam <raviteja.narayanam@...inx.com>,
linux-serial-owner@...r.kernel.org
Subject: Re: [PATCH v3] serial: uartps: Add TACTIVE bit in cdns_uart_tx_empty
function
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
Powered by blists - more mailing lists