All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <haveblue@us.ibm.com>
To: mpm@selenic.com
Cc: linux-kernel@vger.kernel.org, serue@us.ibm.com,
	Dave Hansen <haveblue@us.ibm.com>
Subject: [RFC][PATCH 2/5] pagemap: use PAGE_MASK/PAGE_ALIGN()
Date: Tue, 07 Aug 2007 15:33:01 -0700	[thread overview]
Message-ID: <20070807223301.17F179D5@kernel> (raw)
In-Reply-To: <20070807223300.9228E0E0@kernel>


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

Signed-off-by: Dave Hansen <haveblue@us.ibm.com>
---

 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;
_

  reply	other threads:[~2007-08-07 22:33 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-07 22:33 [RFC][PATCH 1/5] pagemap: remove file header Dave Hansen
2007-08-07 22:33 ` Dave Hansen [this message]
2007-08-08  1:54   ` [RFC][PATCH 2/5] pagemap: use PAGE_MASK/PAGE_ALIGN() Matt Mackall
2007-08-07 22:33 ` [RFC][PATCH 3/5] pagemap: remove open-coded sizeof(unsigned long) Dave Hansen
2007-08-07 23:40   ` Matt Mackall
2007-08-07 23:55     ` Dave Hansen
2007-08-08  2:01       ` Matt Mackall
2007-08-07 22:33 ` [RFC][PATCH 4/5] introduce TASK_SIZE_OF() for all arches Dave Hansen
2007-08-08  2:03   ` Matt Mackall
2007-08-08 18:19     ` Dave Hansen
2007-08-07 22:33 ` [RFC][PATCH 5/5] pagemap: add walker for empty areas Dave Hansen
2007-08-08  1:16 ` [RFC][PATCH 1/5] pagemap: remove file header Matt Mackall
2007-08-08  1:31   ` Alan Cox
2007-08-08  3:51     ` Matt Mackall
2007-08-08 16:34     ` Dave Hansen
2007-08-08 16:53       ` Dave Hansen
     [not found] <8PFSA-6mt-3@gated-at.bofh.it>
     [not found] ` <8PFSA-6mt-1@gated-at.bofh.it>
2007-08-08  7:38   ` [RFC][PATCH 2/5] pagemap: use PAGE_MASK/PAGE_ALIGN() Christian Ehrhardt
2007-08-08 15:11     ` Dave Hansen

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=20070807223301.17F179D5@kernel \
    --to=haveblue@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.com \
    --cc=serue@us.ibm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.