diff options
author | Eric Sesterhenn <snakebyte@gmx.de> | 2006-04-02 07:47:35 -0400 |
---|---|---|
committer | Adrian Bunk <bunk@stusta.de> | 2006-04-02 07:47:35 -0400 |
commit | 75babcacede876608f14ef1a20e795ce17ae637f (patch) | |
tree | 6e81e826ceb3d91662c431ff8c699e95782e207c /mm/highmem.c | |
parent | 9f31252cb61d5bc641cdef8a069a2ca5a77855f2 (diff) |
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: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Diffstat (limited to 'mm/highmem.c')
-rw-r--r-- | mm/highmem.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/mm/highmem.c b/mm/highmem.c index 55885f64af40..9b274fdf9d08 100644 --- a/mm/highmem.c +++ b/mm/highmem.c | |||
@@ -74,8 +74,7 @@ static void flush_all_zero_pkmaps(void) | |||
74 | pkmap_count[i] = 0; | 74 | pkmap_count[i] = 0; |
75 | 75 | ||
76 | /* sanity check */ | 76 | /* sanity check */ |
77 | if (pte_none(pkmap_page_table[i])) | 77 | BUG_ON(pte_none(pkmap_page_table[i])); |
78 | BUG(); | ||
79 | 78 | ||
80 | /* | 79 | /* |
81 | * Don't need an atomic fetch-and-clear op here; | 80 | * Don't need an atomic fetch-and-clear op here; |
@@ -158,8 +157,7 @@ void fastcall *kmap_high(struct page *page) | |||
158 | if (!vaddr) | 157 | if (!vaddr) |
159 | vaddr = map_new_virtual(page); | 158 | vaddr = map_new_virtual(page); |
160 | pkmap_count[PKMAP_NR(vaddr)]++; | 159 | pkmap_count[PKMAP_NR(vaddr)]++; |
161 | if (pkmap_count[PKMAP_NR(vaddr)] < 2) | 160 | BUG_ON(pkmap_count[PKMAP_NR(vaddr)] < 2); |
162 | BUG(); | ||
163 | spin_unlock(&kmap_lock); | 161 | spin_unlock(&kmap_lock); |
164 | return (void*) vaddr; | 162 | return (void*) vaddr; |
165 | } | 163 | } |
@@ -174,8 +172,7 @@ void fastcall kunmap_high(struct page *page) | |||
174 | 172 | ||
175 | spin_lock(&kmap_lock); | 173 | spin_lock(&kmap_lock); |
176 | vaddr = (unsigned long)page_address(page); | 174 | vaddr = (unsigned long)page_address(page); |
177 | if (!vaddr) | 175 | BUG_ON(!vaddr); |
178 | BUG(); | ||
179 | nr = PKMAP_NR(vaddr); | 176 | nr = PKMAP_NR(vaddr); |
180 | 177 | ||
181 | /* | 178 | /* |
@@ -220,8 +217,7 @@ static __init int init_emergency_pool(void) | |||
220 | return 0; | 217 | return 0; |
221 | 218 | ||
222 | page_pool = mempool_create_page_pool(POOL_SIZE, 0); | 219 | page_pool = mempool_create_page_pool(POOL_SIZE, 0); |
223 | if (!page_pool) | 220 | BUG_ON(!page_pool); |
224 | BUG(); | ||
225 | printk("highmem bounce pool size: %d pages\n", POOL_SIZE); | 221 | printk("highmem bounce pool size: %d pages\n", POOL_SIZE); |
226 | 222 | ||
227 | return 0; | 223 | return 0; |
@@ -264,8 +260,7 @@ int init_emergency_isa_pool(void) | |||
264 | 260 | ||
265 | isa_page_pool = mempool_create(ISA_POOL_SIZE, mempool_alloc_pages_isa, | 261 | isa_page_pool = mempool_create(ISA_POOL_SIZE, mempool_alloc_pages_isa, |
266 | mempool_free_pages, (void *) 0); | 262 | mempool_free_pages, (void *) 0); |
267 | if (!isa_page_pool) | 263 | BUG_ON(!isa_page_pool); |
268 | BUG(); | ||
269 | 264 | ||
270 | printk("isa bounce pool size: %d pages\n", ISA_POOL_SIZE); | 265 | printk("isa bounce pool size: %d pages\n", ISA_POOL_SIZE); |
271 | return 0; | 266 | return 0; |