From 68e116a3b57d09b220fe38712bebd956b6dbbbc6 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Sun, 15 Jul 2007 23:38:03 -0700 Subject: [PATCH] MM: use DIV_ROUND_UP() in mm/memory.c Replace a hand coded version of DIV_ROUND_UP(). Signed-off-by: Rolf Eike Beer Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- mm/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memory.c b/mm/memory.c index f64cbf9baa..ee2925998e 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -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) -- 2.39.5