linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: gregkh@linuxfoundation.org, alan@linux.intel.com
Cc: linux-serial@vger.kernel.org,
	Paul Gortmaker <paul.gortmaker@windriver.com>
Subject: [PATCH 7/7] serial: remove back and forth conversions in serial_out_sync
Date: Thu,  8 Mar 2012 19:12:14 -0500	[thread overview]
Message-ID: <1331251934-25540-8-git-send-email-paul.gortmaker@windriver.com> (raw)
In-Reply-To: <1331251934-25540-1-git-send-email-paul.gortmaker@windriver.com>

The two callers to serial_out_sync() have a struct port right
there in scope, but then pass in a struct 8250_port which then
is locally resolved back to a struct port.

Delete the needless back and forth and just pass in the struct
port directly.  Rename the function to have "_port" in its
name, so the name <--> args relationship is consistent with the
other serial_in/out vs serial_port_in/out function classes.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/tty/serial/8250/8250.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c
index 7898295..5b149b4 100644
--- a/drivers/tty/serial/8250/8250.c
+++ b/drivers/tty/serial/8250/8250.c
@@ -467,9 +467,8 @@ static void set_io_from_upio(struct uart_port *p)
 }
 
 static void
-serial_out_sync(struct uart_8250_port *up, int offset, int value)
+serial_port_out_sync(struct uart_port *p, int offset, int value)
 {
-	struct uart_port *p = &up->port;
 	switch (p->iotype) {
 	case UPIO_MEM:
 	case UPIO_MEM32:
@@ -2024,11 +2023,11 @@ static int serial8250_startup(struct uart_port *port)
 			disable_irq_nosync(port->irq);
 
 		wait_for_xmitr(up, UART_LSR_THRE);
-		serial_out_sync(up, UART_IER, UART_IER_THRI);
+		serial_port_out_sync(port, UART_IER, UART_IER_THRI);
 		udelay(1); /* allow THRE to set */
 		iir1 = serial_port_in(port, UART_IIR);
 		serial_port_out(port, UART_IER, 0);
-		serial_out_sync(up, UART_IER, UART_IER_THRI);
+		serial_port_out_sync(port, UART_IER, UART_IER_THRI);
 		udelay(1); /* allow a working UART time to re-assert THRE */
 		iir = serial_port_in(port, UART_IIR);
 		serial_port_out(port, UART_IER, 0);
-- 
1.7.9.1


  parent reply	other threads:[~2012-03-09  0:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-09  0:12 [PATCH v2 0/7] serial: cleanups that strive to do nothing Paul Gortmaker
2012-03-09  0:12 ` [PATCH 1/7] serial: delete last unused traces of pausing I/O in 8250 Paul Gortmaker
2012-03-09  0:12 ` [PATCH 2/7] serial: make 8250's serial_in shareable to other drivers Paul Gortmaker
2012-03-09  0:12 ` [PATCH 3/7] serial: delete useless void casts in 8250.c Paul Gortmaker
2012-03-09  0:12 ` [PATCH 4/7] serial: reduce number of indirections in 8250 code Paul Gortmaker
2012-03-09  0:12 ` [PATCH 5/7] serial: introduce generic port in/out helpers Paul Gortmaker
2012-03-09  0:12 ` [PATCH 6/7] serial: use serial_port_in/out vs serial_in/out in 8250 Paul Gortmaker
2012-03-09  0:12 ` Paul Gortmaker [this message]
2012-03-09 10:29 ` [PATCH v2 0/7] serial: cleanups that strive to do nothing Alan Cox

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=1331251934-25540-8-git-send-email-paul.gortmaker@windriver.com \
    --to=paul.gortmaker@windriver.com \
    --cc=alan@linux.intel.com \
    --cc=gregkh@linuxfoundation.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;
as well as URLs for NNTP newsgroup(s).