Commit b1f3550f authored by Julia Lawall's avatar Julia Lawall Committed by Mark Fasheh

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: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarMark Fasheh <mfasheh@suse.com>
parent c9ec1488
...@@ -1029,8 +1029,7 @@ static void ocfs2_rotate_leaf(struct ocfs2_extent_list *el, ...@@ -1029,8 +1029,7 @@ static void ocfs2_rotate_leaf(struct ocfs2_extent_list *el,
BUG_ON(!next_free); BUG_ON(!next_free);
/* The tree code before us didn't allow enough room in the leaf. */ /* The tree code before us didn't allow enough room in the leaf. */
if (el->l_next_free_rec == el->l_count && !has_empty) BUG_ON(el->l_next_free_rec == el->l_count && !has_empty);
BUG();
/* /*
* The easiest way to approach this is to just remove the * The easiest way to approach this is to just remove the
......
...@@ -717,8 +717,7 @@ int ocfs2_journal_load(struct ocfs2_journal *journal, int local) ...@@ -717,8 +717,7 @@ int ocfs2_journal_load(struct ocfs2_journal *journal, int local)
mlog_entry_void(); mlog_entry_void();
if (!journal) BUG_ON(!journal);
BUG();
osb = journal->j_osb; osb = journal->j_osb;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment