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>
This commit is contained in:
parent
ae03550500
commit
b72b7092f8
|
@ -68,8 +68,7 @@ static int __init vdma_init(void)
|
||||||
*/
|
*/
|
||||||
pgtbl = (VDMA_PGTBL_ENTRY *)__get_free_pages(GFP_KERNEL | GFP_DMA,
|
pgtbl = (VDMA_PGTBL_ENTRY *)__get_free_pages(GFP_KERNEL | GFP_DMA,
|
||||||
get_order(VDMA_PGTBL_SIZE));
|
get_order(VDMA_PGTBL_SIZE));
|
||||||
if (!pgtbl)
|
BUG_ON(!pgtbl);
|
||||||
BUG();
|
|
||||||
dma_cache_wback_inv((unsigned long)pgtbl, VDMA_PGTBL_SIZE);
|
dma_cache_wback_inv((unsigned long)pgtbl, VDMA_PGTBL_SIZE);
|
||||||
pgtbl = (VDMA_PGTBL_ENTRY *)KSEG1ADDR(pgtbl);
|
pgtbl = (VDMA_PGTBL_ENTRY *)KSEG1ADDR(pgtbl);
|
||||||
|
|
||||||
|
|
|
@ -1277,8 +1277,7 @@ static void *set_vi_srs_handler(int n, vi_handler_t addr, int srs)
|
||||||
u32 *w;
|
u32 *w;
|
||||||
unsigned char *b;
|
unsigned char *b;
|
||||||
|
|
||||||
if (!cpu_has_veic && !cpu_has_vint)
|
BUG_ON(!cpu_has_veic && !cpu_has_vint);
|
||||||
BUG();
|
|
||||||
|
|
||||||
if (addr == NULL) {
|
if (addr == NULL) {
|
||||||
handler = (unsigned long) do_default_vi;
|
handler = (unsigned long) do_default_vi;
|
||||||
|
|
|
@ -17,8 +17,7 @@ void *__kmap(struct page *page)
|
||||||
|
|
||||||
void __kunmap(struct page *page)
|
void __kunmap(struct page *page)
|
||||||
{
|
{
|
||||||
if (in_interrupt())
|
BUG_ON(in_interrupt());
|
||||||
BUG();
|
|
||||||
if (!PageHighMem(page))
|
if (!PageHighMem(page))
|
||||||
return;
|
return;
|
||||||
kunmap_high(page);
|
kunmap_high(page);
|
||||||
|
@ -46,8 +45,7 @@ void *__kmap_atomic(struct page *page, enum km_type type)
|
||||||
idx = type + KM_TYPE_NR*smp_processor_id();
|
idx = type + KM_TYPE_NR*smp_processor_id();
|
||||||
vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
|
vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
|
||||||
#ifdef CONFIG_DEBUG_HIGHMEM
|
#ifdef CONFIG_DEBUG_HIGHMEM
|
||||||
if (!pte_none(*(kmap_pte-idx)))
|
BUG_ON(!pte_none(*(kmap_pte - idx)));
|
||||||
BUG();
|
|
||||||
#endif
|
#endif
|
||||||
set_pte(kmap_pte-idx, mk_pte(page, kmap_prot));
|
set_pte(kmap_pte-idx, mk_pte(page, kmap_prot));
|
||||||
local_flush_tlb_one((unsigned long)vaddr);
|
local_flush_tlb_one((unsigned long)vaddr);
|
||||||
|
@ -66,8 +64,7 @@ void __kunmap_atomic(void *kvaddr, enum km_type type)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vaddr != __fix_to_virt(FIX_KMAP_BEGIN+idx))
|
BUG_ON(vaddr != __fix_to_virt(FIX_KMAP_BEGIN + idx));
|
||||||
BUG();
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* force other mappings to Oops if they'll try to access
|
* force other mappings to Oops if they'll try to access
|
||||||
|
|
|
@ -307,8 +307,7 @@ void __init fixrange_init(unsigned long start, unsigned long end,
|
||||||
if (pmd_none(*pmd)) {
|
if (pmd_none(*pmd)) {
|
||||||
pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE);
|
pte = (pte_t *) alloc_bootmem_low_pages(PAGE_SIZE);
|
||||||
set_pmd(pmd, __pmd((unsigned long)pte));
|
set_pmd(pmd, __pmd((unsigned long)pte));
|
||||||
if (pte != pte_offset_kernel(pmd, 0))
|
BUG_ON(pte != pte_offset_kernel(pmd, 0));
|
||||||
BUG();
|
|
||||||
}
|
}
|
||||||
vaddr += PMD_SIZE;
|
vaddr += PMD_SIZE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,8 +27,7 @@ static inline void remap_area_pte(pte_t * pte, unsigned long address,
|
||||||
end = address + size;
|
end = address + size;
|
||||||
if (end > PMD_SIZE)
|
if (end > PMD_SIZE)
|
||||||
end = PMD_SIZE;
|
end = PMD_SIZE;
|
||||||
if (address >= end)
|
BUG_ON(address >= end);
|
||||||
BUG();
|
|
||||||
pfn = phys_addr >> PAGE_SHIFT;
|
pfn = phys_addr >> PAGE_SHIFT;
|
||||||
do {
|
do {
|
||||||
if (!pte_none(*pte)) {
|
if (!pte_none(*pte)) {
|
||||||
|
@ -52,8 +51,7 @@ static inline int remap_area_pmd(pmd_t * pmd, unsigned long address,
|
||||||
if (end > PGDIR_SIZE)
|
if (end > PGDIR_SIZE)
|
||||||
end = PGDIR_SIZE;
|
end = PGDIR_SIZE;
|
||||||
phys_addr -= address;
|
phys_addr -= address;
|
||||||
if (address >= end)
|
BUG_ON(address >= end);
|
||||||
BUG();
|
|
||||||
do {
|
do {
|
||||||
pte_t * pte = pte_alloc_kernel(pmd, address);
|
pte_t * pte = pte_alloc_kernel(pmd, address);
|
||||||
if (!pte)
|
if (!pte)
|
||||||
|
@ -75,8 +73,7 @@ static int remap_area_pages(unsigned long address, phys_t phys_addr,
|
||||||
phys_addr -= address;
|
phys_addr -= address;
|
||||||
dir = pgd_offset(&init_mm, address);
|
dir = pgd_offset(&init_mm, address);
|
||||||
flush_cache_all();
|
flush_cache_all();
|
||||||
if (address >= end)
|
BUG_ON(address >= end);
|
||||||
BUG();
|
|
||||||
do {
|
do {
|
||||||
pud_t *pud;
|
pud_t *pud;
|
||||||
pmd_t *pmd;
|
pmd_t *pmd;
|
||||||
|
|
Loading…
Reference in a new issue