From: Rolf Eike Beer <eike-kernel@sf-tec.de>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: [PATCH] MM: use DIV_ROUND_UP() in mm/memory.c
Date: Thu, 17 May 2007 23:05:10 +0200 [thread overview]
Message-ID: <200705172305.11267.eike-kernel@sf-tec.de> (raw)
In-Reply-To: <20070503202808.4f835c8a.akpm@linux-foundation.org>
Replace a hand coded version of DIV_ROUND_UP().
Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de
---
commit ab35916f807eb4f2019a208e96cb0bddbb91dfc3
tree 6dc4485902c1a96a09ed287270de108630b26719
parent 335aa0289219ca2c1dc309d6bf856d4b25ad8746
author Rolf Eike Beer <eike-kernel@sf-tec.de> Thu, 17 May 2007 23:03:06 +0200
committer Rolf Eike Beer <eike-kernel@sf-tec.de> Thu, 17 May 2007 23:03:06 +0200
mm/memory.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mm/memory.c b/mm/memory.c
index cb94488..5bc26b7 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2674,7 +2674,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)
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2007-05-17 21:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-24 14:10 Rolf Eike Beer
2007-05-04 3:28 ` Andrew Morton
2007-05-17 21:05 ` Rolf Eike Beer [this message]
2007-05-17 21:51 ` Rolf Eike Beer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200705172305.11267.eike-kernel@sf-tec.de \
--to=eike-kernel@sf-tec.de \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox