Skip to contentSkip to conversation

gianfar: fix obviously wrong #ifdef CONFIG_GFAR_NAPI placement

PATCH Applied Anton Vorontsov 3 participants 3 messages Oct 17, 2007 – Oct 18, 2007

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

PATCH 1/1 gianfar: fix obviously wrong #ifdef CONFIG_GFAR_NAPI placement

Erroneous #ifdef introduced by 293c8513398657f6263fcdb03c87f2760cf61be4 causing NAPI-less ethernet malfunctioning.

---

if (...)

#if
	...;

#endif

good candidate for checkpatch?

 drivers/net/gianfar.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/net/gianfar.c +3 -1
index cc288d8..38268d7 100644
@@ -956,10 +956,12 @@ static int gfar_enet_open(struct net_device *dev)
 	}
 
 	err = startup_gfar(dev);
-	if (err)
+	if (err) {
 #ifdef CONFIG_GFAR_NAPI
 		napi_disable(&priv->napi);
 #endif
+		return err;
+	}
 
 	netif_start_queue(dev);
 
Signature · 1 line
1.5.0.6
#2 lore raw
In reply to Anton Vorontsov

The check then is to see if a non {}'d block has no statements in it if the ifdef is null. Hmmm. May be possible. Will think on it.

if (err)
+#ifdef CONFIG_GFAR_NAPI

                napi_disable(&priv->napi);

+#endif

-apw