]> git.baikalelectronics.ru Git - kernel.git/commit
ocfs2: Use BUG_ON
authorJulia Lawall <julia@diku.dk>
Tue, 4 Mar 2008 23:21:05 +0000 (15:21 -0800)
committerMark Fasheh <mfasheh@suse.com>
Fri, 18 Apr 2008 15:56:11 +0000 (08:56 -0700)
commitc8271b69bd863a9867d2a07381f5ccb6dc3110b8
tree0d481a71d202883df116c55fdac4a4a60c4ca091
parenta2d3b4f80b5cdec15e7b05e376154f7aa50bcee5
ocfs2: 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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
fs/ocfs2/alloc.c
fs/ocfs2/journal.c