[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.0904070743380.4010@localhost.localdomain>
Date: Tue, 7 Apr 2009 07:50:38 -0700 (PDT)
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Ingo Molnar <mingo@...e.hu>
cc: David Woodhouse <dwmw2@...radead.org>,
iommu@...ts.linux-foundation.org, linux-kernel@...r.kernel.org
Subject: Re: [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
--
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