lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Sat, 2 Jan 2010 18:01:54 +0100
From:	Frederic Weisbecker <fweisbec@...il.com>
To:	Jeremy Fitzhardinge <jeremy@...p.org>
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 Thu, Dec 31, 2009 at 10:09:43PM +1100, Jeremy Fitzhardinge wrote:
> 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.



Good point! I did not think about compile time optimizations.
I'll try that then. Thanks!

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

Powered by Openwall GNU/*/Linux Powered by OpenVZ