Skip to contentSkip to conversation

net/ethernet: tundra: fix dump_eth_one warning in tsi108_eth

PATCH Applied Paul Gortmaker 2 participants 2 messages Aug 4, 2016 – Aug 8, 2016

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

PATCH 1/1 net/ethernet: tundra: fix dump_eth_one warning in tsi108_eth

The call site for this function appears as:

  #ifdef DEBUG
        data->msg_enable = DEBUG;
        dump_eth_one(dev);
  #endif

...leading to the following warning for !DEBUG builds:

drivers/net/ethernet/tundra/tsi108_eth.c:169:13: warning: 'dump_eth_one' defined but not used [-Wunused-function]
static void dump_eth_one(struct net_device *dev)

             ^

...when using the arch/powerpc/configs/mpc7448_hpc2_defconfig

Put the function definition under the same #ifdef as the call site to avoid the warning.

---
 drivers/net/ethernet/tundra/tsi108_eth.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/tundra/tsi108_eth.c +2 -0
index 01a77145a0fa..8fd131207ee1 100644
@@ -166,6 +166,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);
@@ -190,6 +191,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
2.8.4
maintainer Applied
#1 lore raw

From: Paul Gortmaker <[email protected]>
Date: Thu, 4 Aug 2016 16:07:58 -0400

Quoted 15 lines

The call site for this function appears as:

  #ifdef DEBUG
        data->msg_enable = DEBUG;
        dump_eth_one(dev);
  #endif

...leading to the following warning for !DEBUG builds:

drivers/net/ethernet/tundra/tsi108_eth.c:169:13: warning: 'dump_eth_one' defined but not used [-Wunused-function]
static void dump_eth_one(struct net_device *dev)

             ^

...when using the arch/powerpc/configs/mpc7448_hpc2_defconfig

Quoted 7 lines

Put the function definition under the same #ifdef as the call site to avoid the warning.

Applied, thanks.