public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH v1 1/1] serial: 8520_ce4100: Reuse mem_serial_in() in ce4100_mem_serial_in()
Date: Mon, 30 Jun 2025 15:02:11 +0200	[thread overview]
Message-ID: <023bb251-255d-4f0e-8b2a-d6c8bc35d75b@kernel.org> (raw)
In-Reply-To: <20250630125427.2266455-1-andriy.shevchenko@linux.intel.com>

On 30. 06. 25, 14:54, Andy Shevchenko wrote:
> In one place in ce4100_mem_serial_in() the code may be replaced with
> mem_serial_in() call. Do it so and collapse two conditionals into one.
> 
> Suggested-by: Jiri Slaby <jirislaby@kernel.org>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>   drivers/tty/serial/8250/8250_ce4100.c | 9 ++-------
>   1 file changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_ce4100.c b/drivers/tty/serial/8250/8250_ce4100.c
> index 3dd88f372a51..8221b872fd33 100644
> --- a/drivers/tty/serial/8250/8250_ce4100.c
> +++ b/drivers/tty/serial/8250/8250_ce4100.c
> @@ -35,13 +35,8 @@ static u32 ce4100_mem_serial_in(struct uart_port *p, unsigned int offset)
>   {
>   	u32 ret, ier, lsr;
>   
> -	if (offset != UART_IIR)
> -		return mem_serial_in(p, offset);
> -
> -	offset <<= p->regshift;
> -
> -	ret = readl(p->membase + offset);
> -	if (!(ret & UART_IIR_NO_INT))
> +	ret = mem_serial_in(p, offset);
> +	if (!(offset == UART_IIR) && (ret & UART_IIR_NO_INT))

I am in haste, but a misplaced right paren (should be at the end)?

>   		return ret;
>   
>   	/* see if the TX interrupt should have really set */


-- 
js
suse labs

  reply	other threads:[~2025-06-30 13:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-30 12:54 [PATCH v1 1/1] serial: 8520_ce4100: Reuse mem_serial_in() in ce4100_mem_serial_in() Andy Shevchenko
2025-06-30 13:02 ` Jiri Slaby [this message]
2025-06-30 13:30   ` Andy Shevchenko
2025-07-01  5:14     ` Jiri Slaby

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=023bb251-255d-4f0e-8b2a-d6c8bc35d75b@kernel.org \
    --to=jirislaby@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox