diff options
author | Julia Lawall <julia@diku.dk> | 2008-02-17 21:42:03 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-02-17 21:42:03 -0500 |
commit | 163e3cb7daa8c3a6dde6a13a3d09a198930c6822 (patch) | |
tree | 67b22efc3a5e4ce904f0cc194b7dda92588b2cdd /net/rxrpc/ar-ack.c | |
parent | 9ff566074689e3aed1488780b97714ec43ba361d (diff) |
net/rxrpc: Use BUG_ON
if (...) BUG(); should be replaced with BUG_ON(...) when the test has no
side-effects to allow a definition of BUG_ON that drops the code completely.
The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// <smpl>
@ disable unlikely @ expression E,f; @@
(
if (<... f(...) ...>) { BUG(); }
|
- if (unlikely(E)) { BUG(); }
+ BUG_ON(E);
)
@@ expression E,f; @@
(
if (<... f(...) ...>) { BUG(); }
|
- if (E) { BUG(); }
+ BUG_ON(E);
)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rxrpc/ar-ack.c')
-rw-r--r-- | net/rxrpc/ar-ack.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/rxrpc/ar-ack.c b/net/rxrpc/ar-ack.c index 657ee69f2133..3ac1672e1070 100644 --- a/net/rxrpc/ar-ack.c +++ b/net/rxrpc/ar-ack.c | |||
@@ -814,8 +814,7 @@ static int rxrpc_post_message(struct rxrpc_call *call, u32 mark, u32 error, | |||
814 | spin_lock_bh(&call->lock); | 814 | spin_lock_bh(&call->lock); |
815 | ret = rxrpc_queue_rcv_skb(call, skb, true, fatal); | 815 | ret = rxrpc_queue_rcv_skb(call, skb, true, fatal); |
816 | spin_unlock_bh(&call->lock); | 816 | spin_unlock_bh(&call->lock); |
817 | if (ret < 0) | 817 | BUG_ON(ret < 0); |
818 | BUG(); | ||
819 | } | 818 | } |
820 | 819 | ||
821 | return 0; | 820 | return 0; |