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

From: Kyle Moffett
Date: Tue Apr 07 2009 - 18:42:29 EST


Whoops, resent the original HTML email as plain text, sorry...

On Tue, Apr 7, 2009 at 10:59 AM, Linus Torvalds
<torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> On Tue, 7 Apr 2009, Linus Torvalds wrote:
> >
> > Can we please do it something like the following instead:
> >
> > Â Â Â #define if(a, ...) \
> > Â Â Â Â Â Â Â __trace_if( (a, ## __VA_ARGS__) )
> >
> > so that you don't need to do that ", ## __VA_ARGS__" thing three times?
>
> IOW, does this (TOTALLY UNTESTED) patch work?
>
> Â Â Â Â Â Â Â ÂLinus
>
> -#define if(cond) if (__builtin_constant_p((cond)) ? !!(cond) : Â Â Â Â \
> +#define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) )
> +#define __trace_if(cond) \
> + Â Â Â if (__builtin_constant_p((cond)) ? !!(cond) : Â Â Â Â Â Â Â Â Â \

Umm, why not just use the much nicer pre-C99 GCC syntax? It
automatically makes "cond" expand into the full comma-separated
argument list. No other changes should be necessary. IOW, something
like this:

-#define if(cond) if (__builtin_constant_p((cond)) ? !!(cond) : Â Â Â Â \
+#define if(cond...) if (__builtin_constant_p((cond)) ? !!(cond) : Â Â Â Â \

Cheers,
Kyle Moffett
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/