asm/cputable.h sparse warnings

David Gibson david at gibson.dropbear.id.au
Thu Mar 9 11:08:07 EST 2006


On Wed, Mar 08, 2006 at 04:19:39PM +0100, Christoph Hellwig wrote:
> Looks like not many people are running sparse on powerpc ;-)  For every
> file compiled I get the churn of warnings below.  The reason seems to be
> that it's using large values in enums, something that's very murky in
> the C standards, and gcc adds even less well-defined extensions to it
> that make this code work in practice.  I think the only sane fix is
> to switch the cputype constants to cpp macros, although that'd make the
> file a lot larger..

Removing the enums is problematical, because the method we use with
#ifdefs to get CPU_FTRS_POSSIBLE and CPU_FTRS_ALWAYS correct won't
work with cpp defines.  Or at least defining POSSIBLE and ALWAYS as
macros would be not only much longer, but way harder to maintain
correctly (in fact, I would tend to say impossibly hard).

I was working on a patch to compute the POSSIBLE and ALWAYS masks from
the actual cpu table data structure in cputable.c, which would be
nicer than the #ifdef mess in cputable.h anyway.  I got bogged down in
Kbuild dependency hell and other logistical details, though.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson



More information about the Linuxppc64-dev mailing list