From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org
Cc: Jiri Slaby <jirislaby@kernel.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v2 1/1] serial: 8520_ce4100: Reuse mem_serial_in() in ce4100_mem_serial_in()
Date: Tue, 1 Jul 2025 16:41:38 +0300 [thread overview]
Message-ID: <20250701134200.2621898-1-andriy.shevchenko@linux.intel.com> (raw)
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>
---
v2: fixed condition (Jiri)
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..81dfb2adbabd 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))
return ret;
/* see if the TX interrupt should have really set */
--
2.47.2
next reply other threads:[~2025-07-01 13:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-01 13:41 Andy Shevchenko [this message]
2025-07-02 5:05 ` [PATCH v2 1/1] serial: 8520_ce4100: Reuse mem_serial_in() in ce4100_mem_serial_in() 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=20250701134200.2621898-1-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.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