lkml.org 
[lkml]   [2009]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] intel-iommu: fix build with CONFIG_BRANCH_TRACER=y


On Tue, 7 Apr 2009, Ingo Molnar wrote:
>
> Switch it to a braced group statement.

No, the way to do that is to just clean it up (or in the worst case just
add another set of parenthesis, not a statement expression).

That said, whoever made "if()" a macro should be shot. That
PROFILE_ALL_BRANCHES thing is crazy, crazy.

Anyway, in this case, I think

> #define for_each_active_iommu(i, drhd) \
> list_for_each_entry(drhd, &dmar_drhd_units, list) \
> - if (i=drhd->iommu, drhd->ignored) {} else
> + if (({i=drhd->iommu, drhd->ignored;})) {} else

Just do it like

if ( (i=drhd->iommu, drhd->ignored) ) {} else

is still not pretty, but better than using ({..}) I think. And just a
single set of parenthesis will protect the macro expansion.

But that '#define if(cond)' for the branch profiling is really the core
problem there. Wow. I never realized quite _how_ ugly tricks it played.

Linus


\
 
 \ /
  Last update: 2009-04-07 16:59    [W:0.076 / U:0.492 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site