From 14a61442c2203d2a49f2f954bfa9259c0ddac1aa Mon Sep 17 00:00:00 2001 From: Eric Sesterhenn Date: Tue, 3 Oct 2006 23:36:38 +0200 Subject: BUG_ON conversion for fs/reiserfs This patch converts several if () BUG(); construct to BUG_ON(); which occupies less space, uses unlikely and is safer when BUG() is disabled. S_ISREG() has no side effects, so the conversion is safe. Signed-off-by: Eric Sesterhenn Signed-off-by: Adrian Bunk --- fs/reiserfs/item_ops.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'fs/reiserfs/item_ops.c') diff --git a/fs/reiserfs/item_ops.c b/fs/reiserfs/item_ops.c index 7a88adbceef..b9b423b22a8 100644 --- a/fs/reiserfs/item_ops.c +++ b/fs/reiserfs/item_ops.c @@ -75,8 +75,7 @@ static int sd_create_vi(struct virtual_node *vn, static int sd_check_left(struct virtual_item *vi, int free, int start_skip, int end_skip) { - if (start_skip || end_skip) - BUG(); + BUG_ON(start_skip || end_skip); return -1; } @@ -87,8 +86,7 @@ static int sd_check_right(struct virtual_item *vi, int free) static int sd_part_size(struct virtual_item *vi, int first, int count) { - if (count) - BUG(); + BUG_ON(count); return 0; } @@ -476,8 +474,7 @@ static int direntry_create_vi(struct virtual_node *vn, vi->vi_index = TYPE_DIRENTRY; - if (!(vi->vi_ih) || !vi->vi_item) - BUG(); + BUG_ON(!(vi->vi_ih) || !vi->vi_item); dir_u->flags = 0; if (le_ih_k_offset(vi->vi_ih) == DOT_OFFSET) @@ -575,8 +572,7 @@ static int direntry_check_right(struct virtual_item *vi, int free) free -= dir_u->entry_sizes[i]; entries++; } - if (entries == dir_u->entry_count) - BUG(); + BUG_ON(entries == dir_u->entry_count); /* "." and ".." can not be separated from each other */ if ((dir_u->flags & DIRENTRY_VI_FIRST_DIRENTRY_ITEM) -- cgit v1.2.3