* [PATCH -net] net/ethernet: tundra: fix dump_eth_one warning in tsi108_eth
@ 2016-08-04 20:07 Paul Gortmaker
2016-08-08 20:08 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Paul Gortmaker @ 2016-08-04 20:07 UTC (permalink / raw)
To: netdev; +Cc: Paul Gortmaker, David S. Miller, linuxppc-dev
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>
---
drivers/net/ethernet/tundra/tsi108_eth.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/tundra/tsi108_eth.c b/drivers/net/ethernet/tundra/tsi108_eth.c
index 01a77145a0fa..8fd131207ee1 100644
--- a/drivers/net/ethernet/tundra/tsi108_eth.c
+++ b/drivers/net/ethernet/tundra/tsi108_eth.c
@@ -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
--
2.8.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -net] net/ethernet: tundra: fix dump_eth_one warning in tsi108_eth
2016-08-04 20:07 [PATCH -net] net/ethernet: tundra: fix dump_eth_one warning in tsi108_eth Paul Gortmaker
@ 2016-08-08 20:08 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-08-08 20:08 UTC (permalink / raw)
To: paul.gortmaker; +Cc: netdev, linuxppc-dev
From: Paul Gortmaker <paul.gortmaker@windriver.com>
Date: Thu, 4 Aug 2016 16:07:58 -0400
> 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>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-08-08 20:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-04 20:07 [PATCH -net] net/ethernet: tundra: fix dump_eth_one warning in tsi108_eth Paul Gortmaker
2016-08-08 20:08 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.