MM: use DIV_ROUND_UP() in mm/memory.c
authorRolf Eike Beer <eike-kernel@sf-tec.de>
Mon, 16 Jul 2007 06:38:03 +0000 (23:38 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 16 Jul 2007 16:05:35 +0000 (09:05 -0700)
Replace a hand coded version of DIV_ROUND_UP().

Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/memory.c

index f64cbf9baa3633fc1755f675ec2b46c920c4ecef..ee2925998e2e2e71ba3db28cb603666a293264bc 100644 (file)
@@ -2673,7 +2673,7 @@ int make_pages_present(unsigned long addr, unsigned long end)
        write = (vma->vm_flags & VM_WRITE) != 0;
        BUG_ON(addr >= end);
        BUG_ON(end > vma->vm_end);
-       len = (end+PAGE_SIZE-1)/PAGE_SIZE-addr/PAGE_SIZE;
+       len = DIV_ROUND_UP(end, PAGE_SIZE) - addr/PAGE_SIZE;
        ret = get_user_pages(current, current->mm, addr,
                        len, write, 0, NULL, NULL);
        if (ret < 0)