Skip to contentSkip to conversation

serial: sh-sci: Fix cast warning

PATCH In review Jingoo Han 3 participants 4 messages Feb 5, 2014 – Feb 13, 2014 TTY layer and serial drivers

lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH v2 1/2 serial: sh-sci: Fix cast warning

Fix the following compile warning about cast to pointer from integer of different size.

drivers/tty/serial/sh-sci.c:2021:19: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

---
Changes since V1:
- Use uintptr_t instead of unsigned long per Laurent Pinchart

 drivers/tty/serial/sh-sci.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/sh-sci.c +1 -1
index be33d2b..1668523 100644
@@ -2018,7 +2018,7 @@ static int sci_remap_port(struct uart_port *port)
 		 * need to do any remapping, just cast the cookie
 		 * directly.
 		 */
-		port->membase = (void __iomem *)port->mapbase;
+		port->membase = (void __iomem *)(uintptr_t)port->mapbase;
 	}
 
 	return 0;
Signature · 1 line
1.7.10.4
author
#1 lore raw

PATCH v2 2/2 serial: pch_uart: Fix build warning when CONFIG_DEBUG_FS=n

Add CONFIG_DEBUG_FS to 'char name' in order to fix the following build warning, because 'char name' is used only when CONFIG_DEBUG_FS is enabled.

drivers/tty/serial/pch_uart.c:1765:7: warning: unused variable 'name' [-Wunused-variable]

---
No Changes since V1.

 drivers/tty/serial/pch_uart.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/tty/serial/pch_uart.c +2 -0
index 8fa1134..0931b3f 100644
@@ -1762,7 +1762,9 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
 	int fifosize;
 	int port_type;
 	struct pch_uart_driver_data *board;
+#ifdef CONFIG_DEBUG_FS
 	char name[32];	/* for debugfs file name */
+#endif
 
 	board = &drv_dat[id->driver_data];
 	port_type = board->port_type;
Signature · 1 line
1.7.10.4
Acked-by on v2 1/2
#2 lore raw
In reply to Jingoo Han

Hi Jingoo,

Thank you for the patch.

Quoted 7 lines · On Wednesday 05 February 2014 09:56:37 Jingoo Han wrote:

Fix the following compile warning about cast to pointer from integer of different size.

drivers/tty/serial/sh-sci.c:2021:19: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

Simon, Greg, how do you plan to handle sh-sci patches for v3.15 ?

Quoted 20 lines

---
Changes since V1:
- Use uintptr_t instead of unsigned long per Laurent Pinchart

 drivers/tty/serial/sh-sci.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/sh-sci.c +1 -1
index be33d2b..1668523 100644
@@ -2018,7 +2018,7 @@ static int sci_remap_port(struct uart_port *port)
 		 * need to do any remapping, just cast the cookie
 		 * directly.
 		 */
-		port->membase = (void __iomem *)port->mapbase;
+		port->membase = (void __iomem *)(uintptr_t)port->mapbase;
 	}
 
 	return 0;
Signature · 3 lines
Regards,

Laurent Pinchart
#3 lore raw
Quoted 8 lines · Laurent Pinchart

Hi Jingoo,

Thank you for the patch.

Quoted 3 lines · On Wednesday 05 February 2014 09:56:37 Jingoo Han wrote:

Fix the following compile warning about cast to pointer from integer of different size.

Quoted 8 lines
Quoted 4 lines

drivers/tty/serial/sh-sci.c:2021:19: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

Simon, Greg, how do you plan to handle sh-sci patches for v3.15 ?

This is just a serial driver patch, I'll take it.

thanks,

greg k-h