Skip to content

Commit

Permalink
net: ipv6: Use BUG_ON
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Himangi Saraogi authored and David S. Miller committed Jul 11, 2014
1 parent bc91b0f commit 8242fc3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions net/ipv6/raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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);
Expand Down

0 comments on commit 8242fc3

Please sign in to comment.