BUG_ON() Conversion in mm/memory.c
authorEric Sesterhenn <snakebyte@gmx.de>
Sun, 26 Mar 2006 16:30:52 +0000 (18:30 +0200)
committerAdrian Bunk <bunk@stusta.de>
Sun, 26 Mar 2006 16:30:52 +0000 (18:30 +0200)
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>
mm/memory.c

index e347e106ca3ad4278157431cc39b01ee94bdb931..d90ff9d04957d35a51e455fbe73dd589a04c923d 100644 (file)
@@ -2352,10 +2352,8 @@ int make_pages_present(unsigned long addr, unsigned long end)
        if (!vma)
                return -1;
        write = (vma->vm_flags & VM_WRITE) != 0;
-       if (addr >= end)
-               BUG();
-       if (end > vma->vm_end)
-               BUG();
+       BUG_ON(addr >= end);
+       BUG_ON(end > vma->vm_end);
        len = (end+PAGE_SIZE-1)/PAGE_SIZE-addr/PAGE_SIZE;
        ret = get_user_pages(current, current->mm, addr,
                        len, write, 0, NULL, NULL);