lkml.org 
[lkml]   [2020]   [Feb]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2020-02-01 13:00    [W:0.065 / U:0.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site