Skip to contentSkip to conversation

e1000e: fix debugging printout code

PATCH Applied Auke Kok 3 participants 7 messages Oct 4, 2007 – Oct 15, 2007

Subsystems (2)
lore
Share & tools
lore

Auke Kok

author
#0 lore raw

PATCH 1/1 e1000e: fix debugging printout code

A small bug crawled in the -DDEBUG enabled code. Fix this to properly call the backreference device name.

---

 drivers/net/e1000e/hw.h     |    2 +-
 drivers/net/e1000e/netdev.c |    4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/net/e1000e/hw.h +1 -1
index 848217a..aa82f1a 100644
@@ -852,7 +852,7 @@ struct e1000_hw {
 
 #ifdef DEBUG
 #define hw_dbg(hw, format, arg...) \
-	printk(KERN_DEBUG, "%s: " format, e1000_get_hw_dev_name(hw), ##arg);
+	printk(KERN_DEBUG, "%s: " format, e1000e_get_hw_dev_name(hw), ##arg);
 #else
 static inline int __attribute__ ((format (printf, 2, 3)))
 hw_dbg(struct e1000_hw *hw, const char *format, ...)
drivers/net/e1000e/netdev.c +1 -3
index 4a21d7d..3a0bb2a 100644
@@ -66,9 +66,7 @@ static const struct e1000_info *e1000_info_tbl[] = {
  **/
 char *e1000e_get_hw_dev_name(struct e1000_hw *hw)
 {
-	struct e1000_adapter *adapter = hw->back;
-	struct net_device *netdev = adapter->netdev;
-	return netdev->name;
+	return hw->adapter->netdev->name;
 }
 #endif
 
#1 lore raw
Quoted 15 lines · Auke Kok

A small bug crawled in the -DDEBUG enabled code. Fix this to properly call the backreference device name.

---

 drivers/net/e1000e/hw.h     |    2 +-
 drivers/net/e1000e/netdev.c |    4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/net/e1000e/hw.h +0 -0
index 848217a..aa82f1a 100644

drivers/net/e1000e/hw.h struct e1000_hw { · line 855

Quoted 5 lines
drivers/net/e1000e/hw.h +1 -1
@@ -852,7 +852,7 @@ struct e1000_hw {
 
 #ifdef DEBUG
 #define hw_dbg(hw, format, arg...) \
-	printk(KERN_DEBUG, "%s: " format, e1000_get_hw_dev_name(hw), ##arg);
+	printk(KERN_DEBUG, "%s: " format, e1000e_get_hw_dev_name(hw), ##arg);

I will apply this, but, I strongly encourage deletion of this in favor of the existing dev_dbg()

Jeff

#2 lore raw
Quoted 6 lines · Jeff Garzik
Quoted 6 lines
drivers/net/e1000e/hw.h +0 -0
index 848217a..aa82f1a 100644
@@ -852,7 +852,7 @@ struct e1000_hw {
 
Quoted 7 lines

drivers/net/e1000e/hw.h struct e1000_hw { · line 855

Quoted 4 lines
drivers/net/e1000e/hw.h +1 -1
 #ifdef DEBUG
 #define hw_dbg(hw, format, arg...) \
-	printk(KERN_DEBUG, "%s: " format, e1000_get_hw_dev_name(hw), ##arg);
+	printk(KERN_DEBUG, "%s: " format, e1000e_get_hw_dev_name(hw), ##arg);

I will apply this, but, I strongly encourage deletion of this in favor of the existing dev_dbg()

Instead the fix should be for the 2 existing bugs on macro:

o Comma after KERN_DEBUG
o Semicolon in macro

author
#3 lore raw
Quoted 14 lines · Joe Perches
Quoted 6 lines · Jeff Garzik
Quoted 6 lines
drivers/net/e1000e/hw.h +0 -0
index 848217a..aa82f1a 100644
@@ -852,7 +852,7 @@ struct e1000_hw {
 
Quoted 6 lines

drivers/net/e1000e/hw.h struct e1000_hw { · line 855

Quoted 4 lines
drivers/net/e1000e/hw.h +1 -1
 #ifdef DEBUG
 #define hw_dbg(hw, format, arg...) \
-	printk(KERN_DEBUG, "%s: " format, e1000_get_hw_dev_name(hw), ##arg);
+	printk(KERN_DEBUG, "%s: " format, e1000e_get_hw_dev_name(hw), ##arg);

I will apply this, but, I strongly encourage deletion of this in favor of the existing dev_dbg()

Quoted 4 lines

Instead the fix should be for the 2 existing bugs on macro:

o Comma after KERN_DEBUG
o Semicolon in macro

will push a patch, thanks.

Auke

#4 lore raw
Quoted 4 lines · Auke
Quoted 3 lines

Instead the fix should be for the 2 existing bugs on macro:
o Comma after KERN_DEBUG
o Semicolon in macro

will push a patch, thanks.

Perhaps you could fix this one too?

$ grep -P -r --include=*.[ch] "\bprintk\s*\(\s*KERN_[A-Z]+\s*\," *
drivers/net/ucc_geth_mii.c:#define vdbg(format, arg...) printk(KERN_DEBUG , format "\n" , ## arg)
author
#5 lore raw
Quoted 10 lines · Joe Perches
Quoted 4 lines · Auke
Quoted 3 lines

Instead the fix should be for the 2 existing bugs on macro:
o Comma after KERN_DEBUG
o Semicolon in macro

will push a patch, thanks.

Perhaps you could fix this one too?

$ grep -P -r --include=*.[ch] "\bprintk\s*\(\s*KERN_[A-Z]+\s*\," *
drivers/net/ucc_geth_mii.c:#define vdbg(format, arg...) printk(KERN_DEBUG , format "\n" , ## arg)

Just send a patch yourself... :)

Auke

Applied
#6 lore raw
In reply to Auke Kok
Quoted 9 lines · Auke Kok

A small bug crawled in the -DDEBUG enabled code. Fix this to properly call the backreference device name.

---

 drivers/net/e1000e/hw.h     |    2 +-
 drivers/net/e1000e/netdev.c |    4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)

applied