[RFC/PATCH 2/12] powerpc: Remove #ifdef ISERIES from __raw_* accessors in io.h

David Gibson david at gibson.dropbear.id.au
Tue Jan 17 21:47:47 EST 2006


On Tue, Jan 17, 2006 at 11:38:46AM +0100, Arnd Bergmann wrote:
> On Tuesday 17 January 2006 05:59, David Gibson wrote:
> > > +static inline unsigned char __raw_readb(const volatile void __iomem *addr)
> > > +{
> > > +?????if (firmware_has_feature(FW_FEATURE_ISERIES))
> > > +?????????????BUG();??/* raw accessors aren't supported on iSeries
> > > */
> > 
> > BUG_ON() would seem reasonable here..
> > 
> Actually, I think not. The result of 
> firmware_has_features(FW_FEATURE_ISERIES) should normally be
> a compile-time constant, so the BUG code gets optimized away.
> If you do BUG_ON(), you force the compiler to emit the code for
> that anyway, even if it never causes any action to be taken.

Yes, sfr pointed that out shortly after I sent that.  We should fix
BUG_ON(), or I'm sure I won't be the last to suggest the change..

-- 
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