Re: [PATCH 6/8] drivers-edac-i3000 replace macros with functions

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

 



On Fri, Oct 19, 2007 at 14:11:18 -0700, Andrew Morton wrote:
> On Fri, 19 Oct 2007 13:18:23 -0600
> [email protected] wrote:
> 
> > +static inline unsigned long deap_pfn(u8 edeap, u32 deap)
> > +{
> > +	deap >>= PAGE_SHIFT;
> > +	deap |= (edeap & 1) << (32 - PAGE_SHIFT);
> > +	return deap;
> > +}
> > +
> > +static inline unsigned long deap_offset(u32 deap)
> > +{
> > +	return deap & ~(I3000_DEAP_GRAIN - 1) & ~PAGE_MASK;
> > +}
> > +
> 
> The types here look a bit confused.  Implicit conversions of
> u32s into unsigned longs.

That's deliberate, though perhaps not as clear as it could have been:
We're calculating a pfn and an offset which are logically unsigned
longs (and treated as such by the higher level edac code where they
ultimately get passed) from some bits in config space registers which
are u8/u32.
-
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