[PATCH] igb: update hw_debug macro to make use of netdev_dbg call

Previous thread: [net-2.6 PATCH] igbvf: do not modify tx_queue_len on link speed change by Jeff Kirsher on Thursday, March 25, 2010 - 3:11 pm. (2 messages)

Next thread: UDP path MTU discovery by Glen Turner on Thursday, March 25, 2010 - 5:02 pm. (34 messages)
From: Jeff Kirsher
Date: Thursday, March 25, 2010 - 4:10 pm

From: Alexander Duyck <alexander.h.duyck@intel.com>

This change updates the igb driver to make use of the netdev_dbg function
macros now provided in netdevice.h

This is meant to be provided as an alternative to the patch provided by
Joe Perches.

It also removes igb_get_time_str since I found that it is unused code that
is no longer used even in debug.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---

 drivers/net/igb/e1000_hw.h |   12 +++++-------
 drivers/net/igb/igb_main.c |   32 +++-----------------------------
 2 files changed, 8 insertions(+), 36 deletions(-)

diff --git a/drivers/net/igb/e1000_hw.h b/drivers/net/igb/e1000_hw.h
index 82a533f..fbaff4d 100644
--- a/drivers/net/igb/e1000_hw.h
+++ b/drivers/net/igb/e1000_hw.h
@@ -31,6 +31,7 @@
 #include <linux/types.h>
 #include <linux/delay.h>
 #include <linux/io.h>
+#include <linux/netdevice.h>
 
 #include "e1000_regs.h"
 #include "e1000_defines.h"
@@ -502,14 +503,11 @@ struct e1000_hw {
 	u8  revision_id;
 };
 
-#ifdef DEBUG
-extern char *igb_get_hw_dev_name(struct e1000_hw *hw);
+extern struct net_device *igb_get_hw_dev(struct e1000_hw *hw);
 #define hw_dbg(format, arg...) \
-	printk(KERN_DEBUG "%s: " format, igb_get_hw_dev_name(hw), ##arg)
-#else
-#define hw_dbg(format, arg...)
-#endif
-#endif
+	netdev_dbg(igb_get_hw_dev(hw), format, ##arg)
+
 /* These functions must be implemented by drivers */
 s32  igb_read_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value);
 s32  igb_write_pcie_cap_reg(struct e1000_hw *hw, u32 reg, u16 *value);
+#endif /* _E1000_HW_H_ */
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 01c65c7..1e4d5a6 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -222,43 +222,17 @@ static cycle_t igb_read_clock(const struct cyclecounter *tc)
 	return stamp;
 }
 
-#ifdef DEBUG
 /**
- * igb_get_hw_dev_name - return device name string
+ * igb_get_hw_dev - ...
From: David Miller
Date: Tuesday, March 30, 2010 - 11:01 pm

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

I'll apply this to net-next-2.6, thanks.
--

Previous thread: [net-2.6 PATCH] igbvf: do not modify tx_queue_len on link speed change by Jeff Kirsher on Thursday, March 25, 2010 - 3:11 pm. (2 messages)

Next thread: UDP path MTU discovery by Glen Turner on Thursday, March 25, 2010 - 5:02 pm. (34 messages)