Message ID | 1382647904-11311-6-git-send-email-alex.aring@gmail.com |
---|---|
State | Changes Requested, archived |
Delegated to: | David Miller |
Headers | show |
> 25 окт. 2013 г., в 0:51, Alexander Aring <alex.aring@gmail.com> написал(а): > > Signed-off-by: Alexander Aring <alex.aring@gmail.com> > Reviewed-by: Werner Almesberger <werner@almesberger.net> > --- > net/ieee802154/6lowpan.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c > index e15b101..09350f1 100644 > --- a/net/ieee802154/6lowpan.c > +++ b/net/ieee802154/6lowpan.c > @@ -440,7 +440,6 @@ lowpan_uncompress_udp_header(struct sk_buff *skb, struct udphdr *uh) > default: > pr_debug("ERROR: unknown UDP format\n"); > goto err; > - break; > } > It's not an unnecessary, it's let say a "good coding practice" to have a break for every case including default. > pr_debug("uncompressed UDP ports: src = %d, dst = %d\n", > -- > 1.8.4.1 > -- 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
On Fri, 2013-10-25 at 07:28 +0400, Alexander Smirnov wrote: > > 25 окт. 2013 г., в 0:51, Alexander Aring <alex.aring@gmail.com> написал(а): [] > > diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c [] > > @@ -440,7 +440,6 @@ lowpan_uncompress_udp_header(struct sk_buff *skb, struct udphdr *uh) > > default: > > pr_debug("ERROR: unknown UDP format\n"); > > goto err; > > - break; > > } > > > > It's not an unnecessary, it's let say a "good coding practice" to have a break for every case including default. Hello Alexanders: Some would otherwise say it's a poor practice. -- 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
From: Joe Perches <joe@perches.com> Date: Thu, 24 Oct 2013 20:40:51 -0700 > On Fri, 2013-10-25 at 07:28 +0400, Alexander Smirnov wrote: >> > 25 окт. 2013 г., в 0:51, Alexander Aring <alex.aring@gmail.com> написал(а): > [] >> > diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c > [] >> > @@ -440,7 +440,6 @@ lowpan_uncompress_udp_header(struct sk_buff *skb, struct udphdr *uh) >> > default: >> > pr_debug("ERROR: unknown UDP format\n"); >> > goto err; >> > - break; >> > } >> > >> >> It's not an unnecessary, it's let say a "good coding practice" to have a break for every case including default. > > Hello Alexanders: > > Some would otherwise say it's a poor practice. I think with a goto there at the end of the case statement, it's redundant and stupid, and thus should be removed. -- 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
Hello. On 25-10-2013 7:28, Alexander Smirnov wrote: >> Signed-off-by: Alexander Aring <alex.aring@gmail.com> >> Reviewed-by: Werner Almesberger <werner@almesberger.net> >> --- >> net/ieee802154/6lowpan.c | 1 - >> 1 file changed, 1 deletion(-) >> diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c >> index e15b101..09350f1 100644 >> --- a/net/ieee802154/6lowpan.c >> +++ b/net/ieee802154/6lowpan.c >> @@ -440,7 +440,6 @@ lowpan_uncompress_udp_header(struct sk_buff *skb, struct udphdr *uh) >> default: >> pr_debug("ERROR: unknown UDP format\n"); >> goto err; >> - break; >> } > It's not an unnecessary, it's let say a "good coding practice" to have a break for every case including default. Even after *goto*? :-) WBR, Sergei -- 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 --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c index e15b101..09350f1 100644 --- a/net/ieee802154/6lowpan.c +++ b/net/ieee802154/6lowpan.c @@ -440,7 +440,6 @@ lowpan_uncompress_udp_header(struct sk_buff *skb, struct udphdr *uh) default: pr_debug("ERROR: unknown UDP format\n"); goto err; - break; } pr_debug("uncompressed UDP ports: src = %d, dst = %d\n",