linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] serial: atmel: fix compiler warning on address cast
@ 2015-10-05 17:00 Andre Przywara
  2015-10-08  9:01 ` Alexandre Belloni
  0 siblings, 1 reply; 6+ messages in thread
From: Andre Przywara @ 2015-10-05 17:00 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: Uwe Kleine-König, Greg Kroah-Hartman, Jiri Slaby,
	linux-serial, linux-kernel, linux-arm-kernel

Turning on KVM and LPAE support on top of a multi_v7_defconfig will
produce a compiler warning in the Atmel serial driver:
drivers/tty/serial/atmel_serial.c: In function 'atmel_verify_port':
drivers/tty/serial/atmel_serial.c:2299:6: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  if ((void *)port->mapbase != ser->iomem_base)
      ^

Fix that by using the cast on the right hand side instead, as similar
code already does in other drivers.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 drivers/tty/serial/atmel_serial.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index cd30a45..28039ce 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -2296,7 +2296,7 @@ static int atmel_verify_port(struct uart_port *port, struct serial_struct *ser)
 		ret = -EINVAL;
 	if (port->uartclk / 16 != ser->baud_base)
 		ret = -EINVAL;
-	if ((void *)port->mapbase != ser->iomem_base)
+	if (port->mapbase != (unsigned long)ser->iomem_base)
 		ret = -EINVAL;
 	if (port->iobase != ser->port)
 		ret = -EINVAL;
-- 
2.5.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-10-08 15:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-05 17:00 [PATCH] serial: atmel: fix compiler warning on address cast Andre Przywara
2015-10-08  9:01 ` Alexandre Belloni
2015-10-08  9:37   ` Russell King - ARM Linux
2015-10-08 10:38     ` Alexandre Belloni
2015-10-08 14:49       ` Andre Przywara
2015-10-08 15:01         ` Russell King - ARM Linux

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).