aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/mm/highmem.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2009-03-30 08:49:44 -0400
committerRalf Baechle <ralf@linux-mips.org>2009-03-30 08:49:44 -0400
commitb72b7092f8f5f0729cc9f0868997351f21dbc5cd (patch)
treee384dbc5a43d4a2288360a8ccf6a48f7ba9dfcb4 /arch/mips/mm/highmem.c
parentae03550500654e95c47229775bfec33ed0effe40 (diff)
MIPS: Use BUG_ON() where possible.
Based on original patch by Stoyan Gaydarov <stoyboyker@gmail.com> which missed a few places. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/mm/highmem.c')
-rw-r--r--arch/mips/mm/highmem.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/arch/mips/mm/highmem.c b/arch/mips/mm/highmem.c
index 8f2cd8eda741..060d28dca8a8 100644
--- a/arch/mips/mm/highmem.c
+++ b/arch/mips/mm/highmem.c
@@ -17,8 +17,7 @@ void *__kmap(struct page *page)
17 17
18void __kunmap(struct page *page) 18void __kunmap(struct page *page)
19{ 19{
20 if (in_interrupt()) 20 BUG_ON(in_interrupt());
21 BUG();
22 if (!PageHighMem(page)) 21 if (!PageHighMem(page))
23 return; 22 return;
24 kunmap_high(page); 23 kunmap_high(page);
@@ -46,8 +45,7 @@ void *__kmap_atomic(struct page *page, enum km_type type)
46 idx = type + KM_TYPE_NR*smp_processor_id(); 45 idx = type + KM_TYPE_NR*smp_processor_id();
47 vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); 46 vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
48#ifdef CONFIG_DEBUG_HIGHMEM 47#ifdef CONFIG_DEBUG_HIGHMEM
49 if (!pte_none(*(kmap_pte-idx))) 48 BUG_ON(!pte_none(*(kmap_pte - idx)));
50 BUG();
51#endif 49#endif
52 set_pte(kmap_pte-idx, mk_pte(page, kmap_prot)); 50 set_pte(kmap_pte-idx, mk_pte(page, kmap_prot));
53 local_flush_tlb_one((unsigned long)vaddr); 51 local_flush_tlb_one((unsigned long)vaddr);
@@ -66,8 +64,7 @@ void __kunmap_atomic(void *kvaddr, enum km_type type)
66 return; 64 return;
67 } 65 }
68 66
69 if (vaddr != __fix_to_virt(FIX_KMAP_BEGIN+idx)) 67 BUG_ON(vaddr != __fix_to_virt(FIX_KMAP_BEGIN + idx));
70 BUG();
71 68
72 /* 69 /*
73 * force other mappings to Oops if they'll try to access 70 * force other mappings to Oops if they'll try to access