Skip to contentSkip to conversation

net: wan/lmc: dont print format string when not available

PATCH New Tong Zhang 1 participant 1 message Feb 15, 2021

Subsystems (2)
lore
Share & tools
lore

Tong Zhang

author
#0 lore raw

PATCH 1/1 net: wan/lmc: dont print format string when not available

dev->name is determined only after calling register_hdlc_device(), however ,it is used by printk before the name is fully determined.

  [    4.565137] hdlc%d: detected at e8000000, irq 11

Instead of printing out a %d, print hdlc directly

---
 drivers/net/wan/lmc/lmc_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wan/lmc/lmc_main.c +1 -1
index ebb568f9bc66..6c163db52835 100644
@@ -854,7 +854,7 @@ static int lmc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	spin_lock_init(&sc->lmc_lock);
 	pci_set_master(pdev);
 
-	printk(KERN_INFO "%s: detected at %lx, irq %d\n", dev->name,
+	printk(KERN_INFO "hdlc: detected at %lx, irq %d\n",
 	       dev->base_addr, dev->irq);
 
 	err = register_hdlc_device(dev);
Signature · 1 line
2.25.1