diff mbox

[Trivial] net/wan/hdlc_ppp: remove dead goto

Message ID alpine.LNX.2.00.1108130138100.7387@swampdragon.chaosbits.net
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Jesper Juhl Aug. 12, 2011, 11:39 p.m. UTC
From: Jesper Juhl <jj@chaosbits.net>

We'll either hit one of the case labels or the default in the switch
and in all cases do we then 'goto out', so having 'goto out' right
after the switch is pointless as we can never hit it - remove it.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
 drivers/net/wan/hdlc_ppp.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

Comments

David Miller Aug. 19, 2011, 5:02 a.m. UTC | #1
From: Jesper Juhl <jj@chaosbits.net>
Date: Sat, 13 Aug 2011 01:39:43 +0200 (CEST)

> From: Jesper Juhl <jj@chaosbits.net>
> 
> We'll either hit one of the case labels or the default in the switch
> and in all cases do we then 'goto out', so having 'goto out' right
> after the switch is pointless as we can never hit it - remove it.
> 
> Signed-off-by: Jesper Juhl <jj@chaosbits.net>

Probably a lot cleaner to use break statements in the switch() statement
and keep this goto in place.

That's more straightforward control flow than what this thing is doing.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/wan/hdlc_ppp.c b/drivers/net/wan/hdlc_ppp.c
index 055a918..5385876 100644
--- a/drivers/net/wan/hdlc_ppp.c
+++ b/drivers/net/wan/hdlc_ppp.c
@@ -547,7 +547,6 @@  static int ppp_rx(struct sk_buff *skb)
 		ppp_cp_event(dev, pid, RUC, 0, 0, len, cp);
 		goto out;
 	}
-	goto out;
 
 rx_error:
 	dev->stats.rx_errors++;