From 163e3cb7daa8c3a6dde6a13a3d09a198930c6822 Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Sun, 17 Feb 2008 18:42:03 -0800 Subject: 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 --- net/rxrpc/ar-accept.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'net/rxrpc/ar-accept.c') diff --git a/net/rxrpc/ar-accept.c b/net/rxrpc/ar-accept.c index 92a87fde8bfe..bdfb77417794 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); -- cgit v1.2.3-59-g8ed1b