diff mbox

[2/4] msm_serial: Fix sparse warnings

Message ID 1374691051-28544-3-git-send-email-sboyd@codeaurora.org (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Stephen Boyd July 24, 2013, 6:37 p.m. UTC
drivers/tty/serial/msm_serial.c:302:6: warning: symbol 'msm_set_mctrl' was
not declared. Should it be static?
drivers/tty/serial/msm_serial.c:597:17: warning: incorrect type in argument 2
(different address spaces)
drivers/tty/serial/msm_serial.c:597:17: expected void volatile [noderef] <asn:2>*addr
drivers/tty/serial/msm_serial.c:597:17: got unsigned int *
drivers/tty/serial/msm_serial.c:608:33: warning: incorrect type in argument 1
(different address spaces)
drivers/tty/serial/msm_serial.c:608:33: expected void volatile [noderef] <asn:2>*addr
drivers/tty/serial/msm_serial.c:608:33: got unsigned int *gsbi_base
drivers/tty/serial/msm_serial.c:648:37: warning: incorrect type in assignment
(different address spaces)
drivers/tty/serial/msm_serial.c:648:37: expected unsigned int *gsbi_base
drivers/tty/serial/msm_serial.c:648:37: got void [noderef] <asn:2>*

Mark the ioremapped memory as __iomem and use writel instead of
iowrite because we're not dealing with PCI devices. Also, mark
msm_set_mctrl() static because it isn't used outside this file.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---
 drivers/tty/serial/msm_serial.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

Comments

David Brown July 24, 2013, 8:30 p.m. UTC | #1
On Wed, Jul 24, 2013 at 11:37:29AM -0700, Stephen Boyd wrote:
>drivers/tty/serial/msm_serial.c:302:6: warning: symbol 'msm_set_mctrl' was
>not declared. Should it be static?
>drivers/tty/serial/msm_serial.c:597:17: warning: incorrect type in argument 2
>(different address spaces)
>drivers/tty/serial/msm_serial.c:597:17: expected void volatile [noderef] <asn:2>*addr
>drivers/tty/serial/msm_serial.c:597:17: got unsigned int *
>drivers/tty/serial/msm_serial.c:608:33: warning: incorrect type in argument 1
>(different address spaces)
>drivers/tty/serial/msm_serial.c:608:33: expected void volatile [noderef] <asn:2>*addr
>drivers/tty/serial/msm_serial.c:608:33: got unsigned int *gsbi_base
>drivers/tty/serial/msm_serial.c:648:37: warning: incorrect type in assignment
>(different address spaces)
>drivers/tty/serial/msm_serial.c:648:37: expected unsigned int *gsbi_base
>drivers/tty/serial/msm_serial.c:648:37: got void [noderef] <asn:2>*
>
>Mark the ioremapped memory as __iomem and use writel instead of
>iowrite because we're not dealing with PCI devices. Also, mark
>msm_set_mctrl() static because it isn't used outside this file.
>
>Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
>---
> drivers/tty/serial/msm_serial.c | 17 +++++++----------
> 1 file changed, 7 insertions(+), 10 deletions(-)

Acked-by: David Brown <davidb@codeaurora.org>
diff mbox

Patch

diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c
index fa3fc67..cab4105 100644
--- a/drivers/tty/serial/msm_serial.c
+++ b/drivers/tty/serial/msm_serial.c
@@ -45,7 +45,7 @@  struct msm_port {
 	struct clk		*clk;
 	struct clk		*pclk;
 	unsigned int		imr;
-	unsigned int            *gsbi_base;
+	void __iomem		*gsbi_base;
 	int			is_uartdm;
 	unsigned int		old_snap_state;
 };
@@ -299,7 +299,7 @@  static void msm_reset(struct uart_port *port)
 	msm_write(port, UART_CR_CMD_SET_RFR, UART_CR);
 }
 
-void msm_set_mctrl(struct uart_port *port, unsigned int mctrl)
+static void msm_set_mctrl(struct uart_port *port, unsigned int mctrl)
 {
 	unsigned int mr;
 	mr = msm_read(port, UART_MR1);
@@ -593,12 +593,10 @@  static void msm_release_port(struct uart_port *port)
 	port->membase = NULL;
 
 	if (msm_port->gsbi_base) {
-		iowrite32(GSBI_PROTOCOL_IDLE, msm_port->gsbi_base +
-			  GSBI_CONTROL);
-
-		gsbi_resource = platform_get_resource(pdev,
-							IORESOURCE_MEM, 1);
+		writel_relaxed(GSBI_PROTOCOL_IDLE,
+				msm_port->gsbi_base + GSBI_CONTROL);
 
+		gsbi_resource = platform_get_resource(pdev, IORESOURCE_MEM, 1);
 		if (unlikely(!gsbi_resource))
 			return;
 
@@ -670,10 +668,9 @@  static void msm_config_port(struct uart_port *port, int flags)
 		if (ret)
 			return;
 	}
-
 	if (msm_port->is_uartdm)
-		iowrite32(GSBI_PROTOCOL_UART, msm_port->gsbi_base +
-			  GSBI_CONTROL);
+		writel_relaxed(GSBI_PROTOCOL_UART,
+				msm_port->gsbi_base + GSBI_CONTROL);
 }
 
 static int msm_verify_port(struct uart_port *port, struct serial_struct *ser)