Commit 75babcac authored by Eric Sesterhenn's avatar Eric Sesterhenn Committed by Adrian Bunk

BUG_ON() Conversion in mm/highmem.c

this changes if() BUG(); constructs to BUG_ON() which is
cleaner, contains unlikely() and can better optimized away.
Signed-off-by: default avatarEric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
parent 9f31252c
...@@ -74,8 +74,7 @@ static void flush_all_zero_pkmaps(void) ...@@ -74,8 +74,7 @@ static void flush_all_zero_pkmaps(void)
pkmap_count[i] = 0; pkmap_count[i] = 0;
/* sanity check */ /* sanity check */
if (pte_none(pkmap_page_table[i])) BUG_ON(pte_none(pkmap_page_table[i]));
BUG();
/* /*
* Don't need an atomic fetch-and-clear op here; * Don't need an atomic fetch-and-clear op here;
...@@ -158,8 +157,7 @@ void fastcall *kmap_high(struct page *page) ...@@ -158,8 +157,7 @@ void fastcall *kmap_high(struct page *page)
if (!vaddr) if (!vaddr)
vaddr = map_new_virtual(page); vaddr = map_new_virtual(page);
pkmap_count[PKMAP_NR(vaddr)]++; pkmap_count[PKMAP_NR(vaddr)]++;
if (pkmap_count[PKMAP_NR(vaddr)] < 2) BUG_ON(pkmap_count[PKMAP_NR(vaddr)] < 2);
BUG();
spin_unlock(&kmap_lock); spin_unlock(&kmap_lock);
return (void*) vaddr; return (void*) vaddr;
} }
...@@ -174,8 +172,7 @@ void fastcall kunmap_high(struct page *page) ...@@ -174,8 +172,7 @@ void fastcall kunmap_high(struct page *page)
spin_lock(&kmap_lock); spin_lock(&kmap_lock);
vaddr = (unsigned long)page_address(page); vaddr = (unsigned long)page_address(page);
if (!vaddr) BUG_ON(!vaddr);
BUG();
nr = PKMAP_NR(vaddr); nr = PKMAP_NR(vaddr);
/* /*
...@@ -220,8 +217,7 @@ static __init int init_emergency_pool(void) ...@@ -220,8 +217,7 @@ static __init int init_emergency_pool(void)
return 0; return 0;
page_pool = mempool_create_page_pool(POOL_SIZE, 0); page_pool = mempool_create_page_pool(POOL_SIZE, 0);
if (!page_pool) BUG_ON(!page_pool);
BUG();
printk("highmem bounce pool size: %d pages\n", POOL_SIZE); printk("highmem bounce pool size: %d pages\n", POOL_SIZE);
return 0; return 0;
...@@ -264,8 +260,7 @@ int init_emergency_isa_pool(void) ...@@ -264,8 +260,7 @@ int init_emergency_isa_pool(void)
isa_page_pool = mempool_create(ISA_POOL_SIZE, mempool_alloc_pages_isa, isa_page_pool = mempool_create(ISA_POOL_SIZE, mempool_alloc_pages_isa,
mempool_free_pages, (void *) 0); mempool_free_pages, (void *) 0);
if (!isa_page_pool) BUG_ON(!isa_page_pool);
BUG();
printk("isa bounce pool size: %d pages\n", ISA_POOL_SIZE); printk("isa bounce pool size: %d pages\n", ISA_POOL_SIZE);
return 0; return 0;
......
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