Skip to content

Commit

Permalink
serial: samsung: fix casting warning
Browse files Browse the repository at this point in the history
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@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Jingoo Han authored and Greg Kroah-Hartman committed Aug 12, 2013
1 parent ada1f44 commit 9fdedf5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/tty/serial/samsung.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down

0 comments on commit 9fdedf5

Please sign in to comment.