All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: gregkh@linuxfoundation.org
Cc: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Jiri Slaby" <jslaby@suse.cz>,
	"Tobias Klauser" <tklauser@distanz.ch>
Subject: [PATCH v4 03/10] tty: serial: altera_uart_{r,t}x_chars() need only uart_port
Date: Tue, 20 Sep 2022 07:20:43 +0200	[thread overview]
Message-ID: <20220920052049.20507-4-jslaby@suse.cz> (raw)
In-Reply-To: <20220920052049.20507-1-jslaby@suse.cz>

Both altera_uart_{r,t}x_chars() need only uart_port, not altera_uart. So
pass the former from altera_uart_interrupt() directly.

Apart it maybe saves a dereference, this makes the transition of
altera_uart_tx_chars() easier to follow in the next patch.

Cc: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---

Notes:
    [v4] this is new in v4 -- extracted as a separate change

 drivers/tty/serial/altera_uart.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/tty/serial/altera_uart.c b/drivers/tty/serial/altera_uart.c
index 4170e66601ec..82f2790de28d 100644
--- a/drivers/tty/serial/altera_uart.c
+++ b/drivers/tty/serial/altera_uart.c
@@ -199,9 +199,8 @@ static void altera_uart_set_termios(struct uart_port *port,
 	 */
 }
 
-static void altera_uart_rx_chars(struct altera_uart *pp)
+static void altera_uart_rx_chars(struct uart_port *port)
 {
-	struct uart_port *port = &pp->port;
 	unsigned char ch, flag;
 	unsigned short status;
 
@@ -246,9 +245,8 @@ static void altera_uart_rx_chars(struct altera_uart *pp)
 	tty_flip_buffer_push(&port->state->port);
 }
 
-static void altera_uart_tx_chars(struct altera_uart *pp)
+static void altera_uart_tx_chars(struct uart_port *port)
 {
-	struct uart_port *port = &pp->port;
 	struct circ_buf *xmit = &port->state->xmit;
 
 	if (port->x_char) {
@@ -286,9 +284,9 @@ static irqreturn_t altera_uart_interrupt(int irq, void *data)
 
 	spin_lock(&port->lock);
 	if (isr & ALTERA_UART_STATUS_RRDY_MSK)
-		altera_uart_rx_chars(pp);
+		altera_uart_rx_chars(port);
 	if (isr & ALTERA_UART_STATUS_TRDY_MSK)
-		altera_uart_tx_chars(pp);
+		altera_uart_tx_chars(port);
 	spin_unlock(&port->lock);
 
 	return IRQ_RETVAL(isr);
-- 
2.37.3


  parent reply	other threads:[~2022-09-20  5:21 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-20  5:20 [PATCH v4 00/10] tty: TX helpers Jiri Slaby
2022-09-20  5:20 ` [PATCH v4 01/10] tty: serial: move and cleanup vt8500_tx_empty() Jiri Slaby
2022-09-20  5:20   ` Jiri Slaby
2022-09-20  7:53   ` Ilpo Järvinen
2022-09-20  7:53     ` Ilpo Järvinen
2022-09-20  5:20 ` [PATCH v4 02/10] tty: serial: clean up stop-tx part in altera_uart_tx_chars() Jiri Slaby
2022-09-20  8:03   ` Ilpo Järvinen
2022-09-20 14:17   ` Tobias Klauser
2022-09-20  5:20 ` Jiri Slaby [this message]
2022-09-20  8:04   ` [PATCH v4 03/10] tty: serial: altera_uart_{r,t}x_chars() need only uart_port Ilpo Järvinen
2022-09-20 14:15   ` Tobias Klauser
2022-09-20  5:20 ` [PATCH v4 04/10] tty: serial: extract lqasc_tx_ready() from lqasc_tx_chars() Jiri Slaby
2022-09-20  8:03   ` Ilpo Järvinen
2022-09-20  5:20 ` [PATCH v4 05/10] tty: serial: extract tx_ready() from __serial_lpc32xx_tx() Jiri Slaby
2022-09-20  5:20   ` Jiri Slaby
2022-09-20  8:11   ` Ilpo Järvinen
2022-09-20  8:11     ` Ilpo Järvinen
2022-09-20  5:20 ` [PATCH v4 06/10] tty: serial: switch mpc52xx_uart_int_{r,t}x_chars() to bool Jiri Slaby
2022-09-20  8:37   ` Ilpo Järvinen
2022-09-20  5:20 ` [PATCH v4 07/10] tty: serial: extract serial_omap_put_char() from transmit_chars() Jiri Slaby
2022-09-20  8:37   ` Ilpo Järvinen
2022-09-20  5:20 ` [PATCH v4 08/10] tty: serial: introduce transmit helpers Jiri Slaby
2022-09-20  8:43   ` Ilpo Järvinen
2022-09-20  5:20 ` [PATCH v4 09/10] tty: serial: use uart_port_tx() helper Jiri Slaby
2022-09-20  8:54   ` Ilpo Järvinen
2022-09-20  8:56     ` Jiri Slaby
2022-09-20  7:58 ` [PATCH v4 10/10] tty: serial: use uart_port_tx_limited() Jiri Slaby
2022-09-20  7:58   ` Jiri Slaby
2022-09-20  9:19   ` Ilpo Järvinen
2022-09-20  9:19     ` Ilpo Järvinen
2022-09-20 10:58     ` Jiri Slaby
2022-09-20 10:58       ` Jiri Slaby
2022-09-22 14:15 ` [PATCH v4 00/10] tty: TX helpers Greg KH

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=20220920052049.20507-4-jslaby@suse.cz \
    --to=jslaby@suse.cz \
    --cc=gregkh@linuxfoundation.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=tklauser@distanz.ch \
    /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.