[PATCH] sparse fixes for cpu feature constants

Benjamin Herrenschmidt benh at kernel.crashing.org
Sun Jan 16 09:44:27 EST 2005

On Sun, 2005-01-02 at 09:33 +1100, David Gibson wrote:

> > switch_mm() uses a BEGIN_FTR_SECTION ...
> > END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC) which gets broken by the change
> > since 0x0000000000000008UL winds up in the generated assembly.  I
> > couldn't find the BEGIN/END_FTR_SECTION construct used in any other C
> > code, so I replaced this with the usual bitwise 'and' conditional (I
> > hope someone else will verify that this is equivalent :).
> > 
> > So, does this look like the right thing to do?  It eliminates 129 sparse
> > warnings from a defconfig 2.6.10 build.

Hrm... it's a bit annoying. You are replacing a dynamic patching of the
code by an runtime test... killing a (small tho) optimisation.

There may be other cases where I want to use the CPU feature stuff in
inline assembly..... Not sure what the right fix is, maybe passing the
constant to the asm via the inputs as "i" ...


More information about the Linuxppc64-dev mailing list