All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <haveblue@us.ibm.com>
To: Christian Ehrhardt <Christian_Ehrhardt@genua.de>
Cc: linux-kernel@vger.kernel.org, serue@us.ibm.com
Subject: Re: [RFC][PATCH 2/5] pagemap: use PAGE_MASK/PAGE_ALIGN()
Date: Wed, 08 Aug 2007 08:11:34 -0700	[thread overview]
Message-ID: <1186585894.22283.90.camel@localhost> (raw)
In-Reply-To: <200708080738.l787c6gP007376@felsenbeisser.genua.de>

On Wed, 2007-08-08 at 09:38 +0200, Christian Ehrhardt wrote:
> 
> >       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;
> 
> Unless I'm missing something the PAGE_ALIGN as ist stands is now a NOP
> because uaddr is already page aligned. You probably wanted to
> PAGE_ALIGN(uend). However, this will likely add an additional instruction
> to the generated code. 

Yeah, I aligned the wrong thing.  I'll fix that up.

-- Dave


  reply	other threads:[~2007-08-08 15:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 [this message]
2007-08-07 22:33 [RFC][PATCH 1/5] pagemap: remove file header Dave Hansen
2007-08-07 22:33 ` [RFC][PATCH 2/5] pagemap: use PAGE_MASK/PAGE_ALIGN() Dave Hansen
2007-08-08  1:54   ` Matt Mackall

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=1186585894.22283.90.camel@localhost \
    --to=haveblue@us.ibm.com \
    --cc=Christian_Ehrhardt@genua.de \
    --cc=linux-kernel@vger.kernel.org \
    --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.