Skip to contentSkip to conversation

tty: serial: 8250: Fix type field in format string

PATCH Superseded Hao Lee 2 participants 3 messages Apr 27, 2019 – Apr 29, 2019 TTY layer and serial drivers

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Hao Lee

author
#0 lore raw

PATCH v2 1/1 tty: serial: 8250: Fix type field in format string

The dev_dbg statement should print the value of uart.port.mapbase instead of its address. Besides that, uart.port.irq and uart.port.iotype are all unsigned types, so using %u is more appropriate.

---
 drivers/tty/serial/8250/8250_pnp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/tty/serial/8250/8250_pnp.c +2 -2
index 431e69a5a6a0..9dea11baf479 100644
@@ -462,8 +462,8 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
 		return -ENODEV;
 
 	dev_dbg(&dev->dev,
-		 "Setup PNP port: port %lx, mem %pa, irq %d, type %d\n",
-		 uart.port.iobase, &uart.port.mapbase,
+		 "Setup PNP port: port %#lx, mem %#lx, irq %u, type %u\n",
+		 uart.port.iobase, uart.port.mapbase,
 		 uart.port.irq, uart.port.iotype);
 
 	if (flags & CIR_PORT) {
Signature · 1 line
2.14.5
maintainer
#1 lore raw
Quoted 26 lines · Hao Lee

The dev_dbg statement should print the value of uart.port.mapbase instead of its address. Besides that, uart.port.irq and uart.port.iotype are all unsigned types, so using %u is more appropriate.

---
 drivers/tty/serial/8250/8250_pnp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/tty/serial/8250/8250_pnp.c +2 -2
index 431e69a5a6a0..9dea11baf479 100644
@@ -462,8 +462,8 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id)
 		return -ENODEV;
 
 	dev_dbg(&dev->dev,
-		 "Setup PNP port: port %lx, mem %pa, irq %d, type %d\n",
-		 uart.port.iobase, &uart.port.mapbase,
+		 "Setup PNP port: port %#lx, mem %#lx, irq %u, type %u\n",
+		 uart.port.iobase, uart.port.mapbase,
 		 uart.port.irq, uart.port.iotype);
 
 	if (flags & CIR_PORT) {
Signature · 1 line
2.14.5

This causes build warnings when applied, I'm having to drop it now.

Please be more careful, when submitting patches, always test-build them first.

greg k-h

author
#2 lore raw
Quoted 4 lines · Greg KH

This causes build warnings when applied, I'm having to drop it now.

Please be more careful, when submitting patches, always test-build them first.

I have found my mistake. Although I have built a kernel to test my patch, I forget to turn on the 8250 configurations which are turned off during another kernel test. As a result, 8250_pnp.c was not compiled at all, so I didn't see any warnings. Sorry for that and thanks for your guidance. I will submit my patch v3.