[RFC][PATCH 2/5] pagemap: use PAGE_MASK/PAGE_ALIGN()

From: Dave Hansen
Date: Tue Aug 07 2007 - 18:33:57 EST



Use existing macros (PAGE_MASK/PAGE_ALIGN()) instead of
open-coding them.

Signed-off-by: Dave Hansen <haveblue@xxxxxxxxxx>
---

lxc-dave/fs/proc/task_mmu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN fs/proc/task_mmu.c~pagemap-use-PAGE_MASK fs/proc/task_mmu.c
--- lxc/fs/proc/task_mmu.c~pagemap-use-PAGE_MASK 2007-08-07 15:30:52.000000000 -0700
+++ lxc-dave/fs/proc/task_mmu.c 2007-08-07 15:30:52.000000000 -0700
@@ -669,9 +669,9 @@ static ssize_t pagemap_read(struct file
goto out;

ret = -ENOMEM;
- uaddr = (unsigned long)buf & ~(PAGE_SIZE-1);
+ uaddr = (unsigned long)buf & PAGE_MASK;
uend = (unsigned long)(buf + count);
- pagecount = (uend - uaddr + PAGE_SIZE-1) / PAGE_SIZE;
+ pagecount = (uend - PAGE_ALIGN(uaddr)) / PAGE_SIZE;
pages = kmalloc(pagecount * sizeof(struct page *), GFP_KERNEL);
if (!pages)
goto out_task;
_
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/