[PATCH][NET] gianfar: fix obviously wrong #ifdef CONFIG_GFAR_NAPI placement

Subsystems: networking drivers, the rest

STALE6886d

3 messages, 3 authors, 2007-10-18 · open the first message on its own page

[PATCH][NET] gianfar: fix obviously wrong #ifdef CONFIG_GFAR_NAPI placement

From: Anton Vorontsov <hidden>
Date: 2007-10-17 19:58:23

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

Signed-off-by: Anton Vorontsov <redacted>
Signed-off-by: Vitaly Bordug <redacted>
---

if (...)
#if
	...;
#endif

good candidate for checkpatch?

 drivers/net/gianfar.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index cc288d8..38268d7 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -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);
 
-- 
1.5.0.6

Re: [PATCH][NET] gianfar: fix obviously wrong #ifdef CONFIG_GFAR_NAPI placement

From: Jeff Garzik <hidden>
Date: 2007-10-18 00:22:16

Anton Vorontsov wrote:
Erroneous #ifdef introduced by 293c8513398657f6263fcdb03c87f2760cf61be4
causing NAPI-less ethernet malfunctioning.

Signed-off-by: Anton Vorontsov <redacted>
Signed-off-by: Vitaly Bordug <redacted>
applied

Re: [PATCH][NET] gianfar: fix obviously wrong #ifdef CONFIG_GFAR_NAPI placement

From: Andy Whitcroft <hidden>
Date: 2007-10-18 09:40:40

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help