Re: [RFC][PATCH 3/5] pagemap: remove open-coded sizeof(unsigned long)

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

 



On Tue, Aug 07, 2007 at 04:55:02PM -0700, Dave Hansen wrote:
> On Tue, 2007-08-07 at 18:40 -0500, Matt Mackall wrote:
> > On Tue, Aug 07, 2007 at 03:33:02PM -0700, Dave Hansen wrote:
> > > +#define PAGEMAP_ENTRY_SIZE_BYTES sizeof(unsigned long)
> > > +
> > >  static int add_to_pagemap(unsigned long addr, unsigned long pfn,
> > >  			  struct pagemapread *pm)
> > >  {
> > >  	__put_user(pfn, pm->out);
> > >  	pm->out++;
> > > -	pm->pos += sizeof(unsigned long);
> > > -	pm->count -= sizeof(unsigned long);
> > > -	pm->next = addr + PAGE_SIZE;
> > > +	pm->pos += PAGEMAP_ENTRY_SIZE_BYTES;
> > > +	pm->count -= PAGEMAP_ENTRY_SIZE_BYTES;
> > 
> > I think deleting ->next is a little premature here?
> 
> It is.  I'll fix that up.

While we're at it, it seems a shame to replace the unwieldy typedef
with an even longer define. My poor shift key finger aches just
thinking about typing that. PM_ENTRY_SIZE, perhaps?

-- 
Mathematics is the supreme nostalgia of our time.
-
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