iaf_packet: use BUG_ON
Subsystems (3)
PATCH 1/1 iaf_packet: use BUG_ON
Use BUG_ON(x) rather than if(x) BUG();
The semantic patch that fixes this problem is as follows:
// <smpl>
@@ identifier x; @@
-if (x) BUG();
+BUG_ON(x);
// </smpl>
Signed-off-by Himangi Saraogi <[email protected]>
Acked-by Julia Lawall <[email protected]>
---
To send to: "David S. Miller" <[email protected]>,[email protected],[email protected]
net/packet/af_packet.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
net/packet/af_packet.c +1 -2
@@ -551,8 +551,7 @@ static void prb_setup_retire_blk_timer(struct packet_sock *po, int tx_ring) {struct tpacket_kbdq_core *pkc; -if (tx_ring) -BUG (); +BUG_ON (tx_ring); pkc = tx_ring ?GET_PBDQC_FROM_RB (&po->tx_ring) :GET_PBDQC_FROM_RB (&po->rx_ring);
Signature · 1 line
1.9.1
David Miller
maintainerFrom: Himangi Saraogi <[email protected]>
Date: Wed, 9 Jul 2014 03:50:23 +0530
Quoted 10 lines
Use
BUG_ON(x)rather than if(x)BUG();The semantic patch that fixes this problem is as follows:
// <smpl>
@@ identifier x; @@(quoted diff) +1
-1-if (x) BUG(); +BUG_ON(x);// </smpl>
Quoted 2 lines
Signed-off-by Himangi Saraogi <[email protected]>Acked-by Julia Lawall <[email protected]>
Please repost this with a proper subject line, correcting "iaf_packet".