[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4B3C8677.3030606@goop.org>
Date: Thu, 31 Dec 2009 22:09:43 +1100
From: Jeremy Fitzhardinge <jeremy@...p.org>
To: Frederic Weisbecker <fweisbec@...il.com>
CC: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...e.hu>,
LKML <linux-kernel@...r.kernel.org>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
Paul Mackerras <paulus@...ba.org>
Subject: Re: [PATCH] perf tools: Prevent from BITS_PER_LONG redefinition
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists