Skip to contentSkip to conversation

Staging: hp: Use netdev_warn().

PATCH In review Sam Muhammed 2 participants 2 messages Mar 22, 2020 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v5 1/1 Staging: hp: Use netdev_warn().

This replaces printk(KERN_WARNING ..) with netdev_warn(), as the use of printk() isn't preferred when
a struct net_device is available.

---
Changes in v5:
- Reformat the first netdev_warn() by moving ioaddr to a seperate line to prevent line over 80.

Changes in v4:
- Make log message more clear.

Changes in v3:
- Update subject line and log message to be more descriptive.

Changes in v2:
- Remove " : " from the printing message, netdev_warn() doesn't need it.

 drivers/staging/hp/hp100.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/hp/hp100.c +5 -5
index b89c4dcf53f5..c1f5506b7381 100644
@@ -469,8 +469,8 @@ static int hp100_probe1(struct net_device *dev, int ioaddr, u_char bus,
 
 	eid = hp100_read_id(ioaddr);
 	if (eid == NULL) {	/* bad checksum? */
-		printk(KERN_WARNING "%s: bad ID checksum at base port 0x%x\n",
-		       __func__, ioaddr);
+		netdev_warn(dev, "bad ID checksum at base port 0x%x\n",
+			    ioaddr);
 		goto out2;
 	}
 
@@ -478,9 +478,9 @@ static int hp100_probe1(struct net_device *dev, int ioaddr, u_char bus,
 	for (i = uc = 0; i < 7; i++)
 		uc += hp100_inb(LAN_ADDR + i);
 	if (uc != 0xff) {
-		printk(KERN_WARNING
-		       "%s: bad lan address checksum at port 0x%x)\n",
-		       __func__, ioaddr);
+		netdev_warn(dev,
+			    "bad lan address checksum at port 0x%x)\n",
+			    ioaddr);
 		err = -EIO;
 		goto out2;
 	}

---
2.20.1

Acked-by on v5 1/1
#1 lore raw
Quoted 3 lines · Sam Muhammed

This replaces printk(KERN_WARNING ..) with netdev_warn(), as the use of printk() isn't preferred when
a struct net_device is available.

Quoted 55 lines

---
Changes in v5:
- Reformat the first netdev_warn() by moving ioaddr to a seperate line to prevent line over 80.

Changes in v4:
- Make log message more clear.

Changes in v3:
- Update subject line and log message to be more descriptive.

Changes in v2:
- Remove " : " from the printing message, netdev_warn() doesn't need it.

 drivers/staging/hp/hp100.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/hp/hp100.c +5 -6
index b89c4dcf53f5..c1f5506b7381 100644
@@ -469,8 +469,8 @@ static int hp100_probe1(struct net_device *dev, int ioaddr, u_char bus,
 
 	eid = hp100_read_id(ioaddr);
 	if (eid == NULL) {	/* bad checksum? */
-		printk(KERN_WARNING "%s: bad ID checksum at base port 0x%x\n",
-		       __func__, ioaddr);
+		netdev_warn(dev, "bad ID checksum at base port 0x%x\n",
+			    ioaddr);
 		goto out2;
 	}
 
@@ -478,9 +478,9 @@ static int hp100_probe1(struct net_device *dev, int ioaddr, u_char bus,
 	for (i = uc = 0; i < 7; i++)
 		uc += hp100_inb(LAN_ADDR + i);
 	if (uc != 0xff) {
-		printk(KERN_WARNING
-		       "%s: bad lan address checksum at port 0x%x)\n",
-		       __func__, ioaddr);
+		netdev_warn(dev,
+			    "bad lan address checksum at port 0x%x)\n",
+			    ioaddr);
 		err = -EIO;
 		goto out2;
 	}
---

2.20.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20200322115051.2767-1-jane.pnx9%40gmail.com.