]> pilppa.com Git - linux-2.6-omap-h63xx.git/commit
net/rxrpc: Use BUG_ON
authorJulia Lawall <julia@diku.dk>
Mon, 18 Feb 2008 02:42:03 +0000 (18:42 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 Feb 2008 02:42:03 +0000 (18:42 -0800)
commit163e3cb7daa8c3a6dde6a13a3d09a198930c6822
tree67b22efc3a5e4ce904f0cc194b7dda92588b2cdd
parent9ff566074689e3aed1488780b97714ec43ba361d
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>
net/rxrpc/ar-accept.c
net/rxrpc/ar-ack.c