lkml.org 
[lkml]   [2007]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC][PATCH 2/5] pagemap: use PAGE_MASK/PAGE_ALIGN()
From
Date
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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-08-08 17:15    [W:0.034 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site