* [PATCH] net: ipv6: Use BUG_ON
@ 2014-07-11 20:25 Himangi Saraogi
2014-07-11 22:07 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Himangi Saraogi @ 2014-07-11 20:25 UTC (permalink / raw)
To: David S. Miller, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy, netdev, linux-kernel
Cc: julia.lawall
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 <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
---
To send to: "David S. Miller" <davem@davemloft.net>,Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,James Morris <jmorris@namei.org>,Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,Patrick McHardy <kaber@trash.net>,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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] net: ipv6: Use BUG_ON
2014-07-11 20:25 [PATCH] net: ipv6: Use BUG_ON Himangi Saraogi
@ 2014-07-11 22:07 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-07-11 22:07 UTC (permalink / raw)
To: himangi774
Cc: kuznet, jmorris, yoshfuji, kaber, netdev, linux-kernel,
julia.lawall
From: Himangi Saraogi <himangi774@gmail.com>
Date: Sat, 12 Jul 2014 01:55:38 +0530
> 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 <himangi774@gmail.com>
> Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-07-11 22:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-11 20:25 [PATCH] net: ipv6: Use BUG_ON Himangi Saraogi
2014-07-11 22:07 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).