Re: [PATCH] intel-iommu: fix build with CONFIG_BRANCH_TRACER=y

David Woodhouse
2009-04-07T11:34:50Z

On Tue, 2009-04-07 at 11:02 +0200, Ingo Molnar wrote:
> for_each_active_iommu() and for_each_iommu() uses some tricky
> C that is weird and borderline valid but does not allow the
> macro evaluation trick used by the branch tracer/profiler:
>
> drivers/pci/intr_remapping.c:680:28: error: macro "if" passed 2
> arguments, but takes just 1
>
> Switch it to a braced group statement.

It doesn't even need the braces -- just putting simple parens around the
comma-expression would have sufficed (that was Andrew's attempt).

But it's a workaround, not a fix -- if we're going to #define if() then
we should damn well make it transparent, and not have to work around
breakage in arbitrary places.

Hence the patch I sent to Linus last night, which fixes it in the
_right_ place:
http://marc.info/?l=linux-kernel&m=123907505308502&w=2

--
David Woodhouse Open Source Technology Centre
David.Woodhouse@intel.com Intel Corporation