Skip to content

Commit

Permalink
net/ethernet: tundra: fix dump_eth_one warning in tsi108_eth
Browse files Browse the repository at this point in the history
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.

Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Paul Gortmaker authored and David S. Miller committed Aug 8, 2016
1 parent 61ec4bc commit 66cf350
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/ethernet/tundra/tsi108_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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
Expand Down

0 comments on commit 66cf350

Please sign in to comment.