Fix build errors due to CONFIG_BRANCH_TRACER=y

The code that enables branch tracing for all (non-constant) branches
plays games with the preprocessor and #define's the C 'if ()' construct
to do tracing.

That's all fine, but it fails for some unusual but valid C code that is
sometimes used in macros, notably by the intel-iommu code:

if (i=drhd->iommu, drhd->ignored) ..

because now the preprocessor complains about multiple arguments to the
'if' macro.

So make the macro expansion of this particularly horrid trick use
varargs, and handle the case of comma-expressions in if-statements. Use
another macro to do it cleanly in just one place.

This replaces a patch by David (and acked by Steven) that did this all
inside that one already-too-horrid macro.

Tested-by: Ingo Molnar <mingo@elte.hu>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

+3 -1
+3 -1
include/linux/compiler.h
··· 114 114 * "Define 'is'", Bill Clinton 115 115 * "Define 'if'", Steven Rostedt 116 116 */ 117 - #define if(cond) if (__builtin_constant_p((cond)) ? !!(cond) : \ 117 + #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) ) 118 + #define __trace_if(cond) \ 119 + if (__builtin_constant_p((cond)) ? !!(cond) : \ 118 120 ({ \ 119 121 int ______r; \ 120 122 static struct ftrace_branch_data \