Re: [PATCH] perf tools: Prevent from BITS_PER_LONG redefinition

From: Jeremy Fitzhardinge
Date: Sat Jan 02 2010 - 00:49:44 EST


On 12/31/2009 08:45 AM, Frederic Weisbecker wrote:
You can use if() with a constant expression instead of #if.


I did not write this code. But yes you're right, although I
think CPP is more suitable here because fls() can be called
from fastpath and this conditional build makes one check less
and lesser i-cache footprint.

Constant if()s are removed at compile time, so there should be no runtime overhead. Constant if()s are generally preferable to #if because the compile will statically check the other code branch, even if it never gets executed, which helps prevent it from rotting.

J

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/