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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 [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]
  Powered by Linux