All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maarten Brock <m.brock@vanmierlo.com>
To: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Cc: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org,
	jslaby@suse.com, michal.simek@xilinx.com,
	linux-kernel@vger.kernel.org,
	Raviteja Narayanam <raviteja.narayanam@xilinx.com>,
	linux-serial-owner@vger.kernel.org
Subject: Re: [PATCH v3] serial: uartps: Add TACTIVE bit in cdns_uart_tx_empty function
Date: Sat, 01 Feb 2020 12:29:15 +0100	[thread overview]
Message-ID: <44b8cf91d3d2f20a81e0215b1b2fc7a8@vanmierlo.com> (raw)
In-Reply-To: <1580468685-11373-1-git-send-email-shubhrajyoti.datta@xilinx.com>

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


      parent reply	other threads:[~2020-02-01 11:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-31 11:04 [PATCH v3] serial: uartps: Add TACTIVE bit in cdns_uart_tx_empty function Shubhrajyoti Datta
2020-01-31 14:18 ` Johan Hovold
2020-02-01 11:29 ` Maarten Brock [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44b8cf91d3d2f20a81e0215b1b2fc7a8@vanmierlo.com \
    --to=m.brock@vanmierlo.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial-owner@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=raviteja.narayanam@xilinx.com \
    --cc=shubhrajyoti.datta@xilinx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.