Skip to contentSkip to conversation

au1000-eth: fix bad printk usages

PATCH Superseded Florian Fainelli 2 participants 2 messages Aug 9, 2010

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 4/6 au1000-eth: fix bad printk usages

Use pr_(info|err) and pr_cont where required instead of calls to printk.

---

drivers/net/au1000_eth.c +12 -10
index 9a0515d..f8f1f5e 100644
@@ -732,24 +732,25 @@ static int au1000_rx(struct net_device *dev)
 			netif_rx(skb);	/* pass the packet to upper layers */
 		} else {
 			if (au1000_debug > 4) {
+				pr_err("rx_error: ");
 				if (status & RX_MISSED_FRAME)
-					printk("rx miss\n");
+					pr_cont("rx miss\n");
 				if (status & RX_WDOG_TIMER)
-					printk("rx wdog\n");
+					pr_cont("rx wdog\n");
 				if (status & RX_RUNT)
-					printk("rx runt\n");
+					pr_cont("rx runt\n");
 				if (status & RX_OVERLEN)
-					printk("rx overlen\n");
+					pr_cont("rx overlen\n");
 				if (status & RX_COLL)
-					printk("rx coll\n");
+					pr_cont("rx coll\n");
 				if (status & RX_MII_ERROR)
-					printk("rx mii error\n");
+					pr_cont("rx mii error\n");
 				if (status & RX_CRC_ERROR)
-					printk("rx crc error\n");
+					pr_cont("rx crc error\n");
 				if (status & RX_LEN_ERROR)
-					printk("rx len error\n");
+					pr_cont("rx len error\n");
 				if (status & RX_U_CNTRL_FRAME)
-					printk("rx u control frame\n");
+					pr_cont("rx u control frame\n");
 			}
 		}
 		prxd->buff_stat = (u32)(pDB->dma_addr | RX_DMA_ENABLE);
@@ -1225,7 +1226,8 @@ static int __devinit au1000_probe(struct platform_device *pdev)
 	netdev_info(dev, "Au1xx0 Ethernet found at 0x%lx, irq %d\n",
 			(unsigned long)base->start, irq);
 	if (version_printed++ == 0)
-		printk("%s version %s %s\n", DRV_NAME, DRV_VERSION, DRV_AUTHOR);
+		pr_info("%s version %s %s\n",
+					DRV_NAME, DRV_VERSION, DRV_AUTHOR);
 
 	return 0;
 
#1 lore raw

drivers/net/au1000_eth.c static int au1000_rx(struct net_device *dev) · line 735

Quoted 13 lines · Florian Fainelli

Use pr_(info|err) and pr_cont where required instead of calls to printk.

---

drivers/net/au1000_eth.c +1 -0
index 9a0515d..f8f1f5e 100644
@@ -732,24 +732,25 @@ static int au1000_rx(struct net_device *dev)
 			netif_rx(skb);	/* pass the packet to upper layers */
 		} else {
 			if (au1000_debug > 4) {
+				pr_err("rx_error: ");

This should be:

				pr_err("rx_error(s):");

drivers/net/au1000_eth.c static int au1000_rx(struct net_device *dev) · line 737

Quoted 3 lines
drivers/net/au1000_eth.c +1 -1
 				if (status & RX_MISSED_FRAME)
-					printk("rx miss\n");
+					pr_cont("rx miss\n");

These blocks should be "pr_cont(" value");

with a leading space and without the "\n"

drivers/net/au1000_eth.c static int au1000_rx(struct net_device *dev) · line 739

Quoted 3 lines
drivers/net/au1000_eth.c +1 -1
 				if (status & RX_WDOG_TIMER)
-					printk("rx wdog\n");
+					pr_cont("rx wdog\n");

[etc]

drivers/net/au1000_eth.c static int au1000_rx(struct net_device *dev) · line 753

Quoted 3 lines
drivers/net/au1000_eth.c +1 -1
 				if (status & RX_U_CNTRL_FRAME)
-					printk("rx u control frame\n");
+					pr_cont("rx u control frame\n");

and finally a pr_cont("\n");

It'd also be good to add

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

before any #include