[PATCH 01/10] serial: samsung: fix casting warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



port->membase is (unsigned char __iomem *), not (unsigned long *)
__set_bit() uses (unsigned long *) as the second argument.
Thus, casting (unsigned long *)(unsigned long) is necessary
to fix the following sparse warnings.

drivers/tty/serial/samsung.c:142:33: warning: cast removes address space of expression
drivers/tty/serial/samsung.c:161:33: warning: cast removes address space of expression
drivers/tty/serial/samsung.c:176:33: warning: cast removes address space of expression
drivers/tty/serial/samsung.c:526:40: warning: cast removes address space of expression

Signed-off-by: Jingoo Han <jg1.han@xxxxxxxxxxx>
---
 drivers/tty/serial/samsung.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/samsung.h b/drivers/tty/serial/samsung.h
index 00a499e..aaa617a 100644
--- a/drivers/tty/serial/samsung.h
+++ b/drivers/tty/serial/samsung.h
@@ -68,7 +68,8 @@ struct s3c24xx_uart_port {
 /* register access controls */
 
 #define portaddr(port, reg) ((port)->membase + (reg))
-#define portaddrl(port, reg) ((unsigned long *)((port)->membase + (reg)))
+#define portaddrl(port, reg) \
+	((unsigned long *)(unsigned long)((port)->membase + (reg)))
 
 #define rd_regb(port, reg) (__raw_readb(portaddr(port, reg)))
 #define rd_regl(port, reg) (__raw_readl(portaddr(port, reg)))
-- 
1.7.10.4


--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux