[PATCH] net: ipv6: Use BUG_ON

Subsystems: networking [general], the rest

STALE4406d REVIEWED: 1 (0M)

1 review trailer.

2 messages, 2 authors, 2014-07-11 · open the first message on its own page

[PATCH] net: ipv6: Use BUG_ON

From: Himangi Saraogi <hidden>
Date: 2014-07-11 20:25:49

The semantic patch that makes the transformation is as follows:

// <smpl>
@@ expression e; @@
-if (e) BUG();
+BUG_ON(e);
// </smpl>

Signed-off-by: Himangi Saraogi <redacted>
Acked-by: Julia Lawall <redacted>
---
To send to: "David S. Miller" [off-list ref],Alexey Kuznetsov [off-list ref],James Morris [off-list ref],Hideaki YOSHIFUJI [off-list ref],Patrick McHardy [off-list ref],netdev@vger.kernel.org,linux-kernel@vger.kernel.org
 net/ipv6/raw.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index b2dc60b..dee80fb 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -588,8 +588,7 @@ static int rawv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6,
 	}
 
 	offset += skb_transport_offset(skb);
-	if (skb_copy_bits(skb, offset, &csum, 2))
-		BUG();
+	BUG_ON(skb_copy_bits(skb, offset, &csum, 2));
 
 	/* in case cksum was not initialized */
 	if (unlikely(csum))
@@ -601,8 +600,7 @@ static int rawv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6,
 	if (csum == 0 && fl6->flowi6_proto == IPPROTO_UDP)
 		csum = CSUM_MANGLED_0;
 
-	if (skb_store_bits(skb, offset, &csum, 2))
-		BUG();
+	BUG_ON(skb_store_bits(skb, offset, &csum, 2));
 
 send:
 	err = ip6_push_pending_frames(sk);
-- 
1.9.1

Re: [PATCH] net: ipv6: Use BUG_ON

From: David Miller <davem@davemloft.net>
Date: 2014-07-11 22:07:06

From: Himangi Saraogi <redacted>
Date: Sat, 12 Jul 2014 01:55:38 +0530
quoted hunk
The semantic patch that makes the transformation is as follows:

// <smpl>
@@ expression e; @@
-if (e) BUG();
+BUG_ON(e);
// </smpl>

Signed-off-by: Himangi Saraogi <redacted>
Acked-by: Julia Lawall <redacted>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help