[PATCH]: powerpc: Fix build breakage due to incorrect location of autoconf.h

Benjamin Herrenschmidt benh at kernel.crashing.org
Thu Jan 14 19:57:11 EST 2010


> Seen it now as it is in Linus tree:
> 
> 1) IMHO it would have been nicer to use #ifdef __KERNEL__
>    instead of CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
>    as then arches that don't define CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
>    at all will never use the new optimization or was that what you intended?

No, that was on purpose. If an arch doesn't have efficient unaligned
accesses, then they should not use the optimization since it will result
in a lot of unaligned accesses :-) In which case they are better off
falling back to the old byte-by-byte method.

The advantage also of doing it this way is that x86 will benefit from
the optimisation at boot time since it does include autoconf.h in its
boot wrapper (and deals with unaligned accesses just fine at any time)
though something tells me that it won't make much of a difference in
performances on any recent x86 (it might on some of the newer low power
embedded ones, I don't know for sure).

> 2) You really should add an comment in the Makefile about not using
>    autoconf.h/-D__KERNEL__

That's true :-)

Cheers,
Ben.




More information about the Linuxppc-dev mailing list