Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[pandora-kernel.git] / arch / mips / mm / ioremap.c
index cea7d0e..0c43248 100644 (file)
@@ -9,7 +9,7 @@
 #include <linux/module.h>
 #include <asm/addrspace.h>
 #include <asm/byteorder.h>
-
+#include <linux/sched.h>
 #include <linux/vmalloc.h>
 #include <asm/cacheflush.h>
 #include <asm/io.h>
@@ -27,8 +27,7 @@ static inline void remap_area_pte(pte_t * pte, unsigned long address,
        end = address + size;
        if (end > PMD_SIZE)
                end = PMD_SIZE;
-       if (address >= end)
-               BUG();
+       BUG_ON(address >= end);
        pfn = phys_addr >> PAGE_SHIFT;
        do {
                if (!pte_none(*pte)) {
@@ -52,8 +51,7 @@ static inline int remap_area_pmd(pmd_t * pmd, unsigned long address,
        if (end > PGDIR_SIZE)
                end = PGDIR_SIZE;
        phys_addr -= address;
-       if (address >= end)
-               BUG();
+       BUG_ON(address >= end);
        do {
                pte_t * pte = pte_alloc_kernel(pmd, address);
                if (!pte)
@@ -75,8 +73,7 @@ static int remap_area_pages(unsigned long address, phys_t phys_addr,
        phys_addr -= address;
        dir = pgd_offset(&init_mm, address);
        flush_cache_all();
-       if (address >= end)
-               BUG();
+       BUG_ON(address >= end);
        do {
                pud_t *pud;
                pmd_t *pmd;