Commit e827f92355e1eeec2d227d3bd3350d04042a011e

Authored by Eric Sesterhenn
Committed by Adrian Bunk
1 parent fddaaae16b

BUG_ON() Conversion in fs/buffer.c

this changes if() BUG(); constructs to BUG_ON() which is
cleaner and can better optimized away

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>

Showing 1 changed file with 3 additions and 6 deletions Side-by-side Diff

... ... @@ -796,8 +796,7 @@
796 796 if (!mapping->assoc_mapping) {
797 797 mapping->assoc_mapping = buffer_mapping;
798 798 } else {
799   - if (mapping->assoc_mapping != buffer_mapping)
800   - BUG();
  799 + BUG_ON(mapping->assoc_mapping != buffer_mapping);
801 800 }
802 801 if (list_empty(&bh->b_assoc_buffers)) {
803 802 spin_lock(&buffer_mapping->private_lock);
... ... @@ -1114,8 +1113,7 @@
1114 1113 if (!page)
1115 1114 return NULL;
1116 1115  
1117   - if (!PageLocked(page))
1118   - BUG();
  1116 + BUG_ON(!PageLocked(page));
1119 1117  
1120 1118 if (page_has_buffers(page)) {
1121 1119 bh = page_buffers(page);
... ... @@ -1522,8 +1520,7 @@
1522 1520 struct page *page, unsigned long offset)
1523 1521 {
1524 1522 bh->b_page = page;
1525   - if (offset >= PAGE_SIZE)
1526   - BUG();
  1523 + BUG_ON(offset >= PAGE_SIZE);
1527 1524 if (PageHighMem(page))
1528 1525 /*
1529 1526 * This catches illegal uses and preserves the offset: