Use existing macros (PAGE_MASK/PAGE_ALIGN()) instead of
open-coding them.
Signed-off-by: Dave Hansen <[email protected]>
---
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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]