Skip to contentSkip to conversation

net: tsi108: Prevent compiler warning

PATCH In review Thierry Reding 2 participants 3 messages Sep 18, 2013 – Sep 19, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: tsi108: Prevent compiler warning

The dump_eth_one() function is only used if DEBUG is enabled, so protect it by a corresponding #ifdef DEBUG block.

---
 drivers/net/ethernet/tundra/tsi108_eth.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/tundra/tsi108_eth.c +2 -0
index c4dbf98..a452d93 100644
@@ -168,6 +168,7 @@ static struct platform_driver tsi_eth_driver = {
 
 static void tsi108_timed_checker(unsigned long dev_ptr);
 
+#ifdef DEBUG
 static void dump_eth_one(struct net_device *dev)
 {
 	struct tsi108_prv_data *data = netdev_priv(dev);
@@ -192,6 +193,7 @@ static void dump_eth_one(struct net_device *dev)
 	       TSI_READ(TSI108_EC_RXESTAT),
 	       TSI_READ(TSI108_EC_RXERR), data->rxpending);
 }
+#endif
 
 /* Synchronization is needed between the thread and up/down events.
  * Note that the PHY is accessed through the same registers for both
Signature · 1 line
1.8.4
maintainer
#1 lore raw

From: Thierry Reding <[email protected]>
Date: Wed, 18 Sep 2013 14:49:55 +0200

Quoted 4 lines

The dump_eth_one() function is only used if DEBUG is enabled, so protect it by a corresponding #ifdef DEBUG block.

I would prefer that this function and the one call site is simply removed instead.

This kind of thing can be provided via ethtool register dumps and therefore without all of the ugliness this ad-hoc stuff presents.

#2 lore raw
Quoted 6 lines · David Miller

From: Thierry Reding <[email protected]>
Date: Wed, 18 Sep 2013 14:49:55 +0200

Quoted 3 lines

The dump_eth_one() function is only used if DEBUG is enabled, so protect it by a corresponding #ifdef DEBUG block.

Quoted 8 lines
Quoted 1 line

I would prefer that this function and the one call site is simply removed instead.

This kind of thing can be provided via ethtool register dumps and therefore without all of the ugliness this ad-hoc stuff presents.

I just noticed the warning during some test builds I was doing due to some unrelated patches and thought I'd clean it up along the way.

I'll send a patch to remove the functionality completely if that's what you prefer, but I won't be able to reimplement it using ethtool. Perhaps someone with actual hardware can do that.

Thierry