From: Rolf Eike Beer Date: Mon, 16 Jul 2007 06:38:03 +0000 (-0700) Subject: MM: use DIV_ROUND_UP() in mm/memory.c X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=68e116a3b57d09b220fe38712bebd956b6dbbbc6;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 --- diff --git a/mm/memory.c b/mm/memory.c index f64cbf9baa36..ee2925998e2e 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)