Netdev List
 help / color / mirror / Atom feed
* [PATCH] [net-next] macb: fix build warning for !CONFIG_OF
@ 2019-07-08 12:48 Arnd Bergmann
  2019-07-08 19:43 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2019-07-08 12:48 UTC (permalink / raw)
  To: Nicolas Ferre, David S. Miller, Palmer Dabbelt, Paul Walmsley
  Cc: Arnd Bergmann, Yash Shah, Harini Katakam, Claudiu Beznea, netdev,
	linux-kernel, linux-riscv

When CONFIG_OF is disabled, we get a harmless warning about the
newly added variable:

drivers/net/ethernet/cadence/macb_main.c:48:39: error: 'mgmt' defined but not used [-Werror=unused-variable]
 static struct sifive_fu540_macb_mgmt *mgmt;

Move the variable closer to its use inside of the #ifdef.

Fixes: c218ad559020 ("macb: Add support for SiFive FU540-C000")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/net/ethernet/cadence/macb_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index a27d32f69de9..5ca17e62dc3e 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -45,8 +45,6 @@ struct sifive_fu540_macb_mgmt {
 	struct clk_hw hw;
 };
 
-static struct sifive_fu540_macb_mgmt *mgmt;
-
 #define MACB_RX_BUFFER_SIZE	128
 #define RX_BUFFER_MULTIPLE	64  /* bytes */
 
@@ -3628,6 +3626,8 @@ static int macb_init(struct platform_device *pdev)
 /* max number of receive buffers */
 #define AT91ETHER_MAX_RX_DESCR	9
 
+static struct sifive_fu540_macb_mgmt *mgmt;
+
 /* Initialize and start the Receiver and Transmit subsystems */
 static int at91ether_start(struct net_device *dev)
 {
-- 
2.20.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-08 19:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-08 12:48 [PATCH] [net-next] macb: fix build warning for !CONFIG_OF Arnd Bergmann
2019-07-08 19:43 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox