From: Julia Lawall Date: Mon, 18 Feb 2008 02:42:03 +0000 (-0800) Subject: net/rxrpc: Use BUG_ON X-Git-Tag: v2.6.25-rc3~9^2~58 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=163e3cb7daa8c3a6dde6a13a3d09a198930c6822;p=platform%2Fkernel%2Flinux-exynos.git 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/) // @ 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); ) // Signed-off-by: Julia Lawall Signed-off-by: David S. Miller --- diff --git a/net/rxrpc/ar-accept.c b/net/rxrpc/ar-accept.c index 92a87fd..bdfb774 100644 --- a/net/rxrpc/ar-accept.c +++ b/net/rxrpc/ar-accept.c @@ -156,8 +156,7 @@ static int rxrpc_accept_incoming_call(struct rxrpc_local *local, false); spin_unlock(&call->lock); notification = NULL; - if (ret < 0) - BUG(); + BUG_ON(ret < 0); } spin_unlock(&call->conn->state_lock); diff --git a/net/rxrpc/ar-ack.c b/net/rxrpc/ar-ack.c index 657ee69..3ac1672 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, spin_lock_bh(&call->lock); ret = rxrpc_queue_rcv_skb(call, skb, true, fatal); spin_unlock_bh(&call->lock); - if (ret < 0) - BUG(); + BUG_ON(ret < 0); } return 0;