[<prev] [next>] [day] [month] [year] [list]
Message-ID: <f73f7ab80904071542r1d3e5e1au21c8c4ded9d36f7d@mail.gmail.com>
Date: Tue, 7 Apr 2009 18:42:17 -0400
From: Kyle Moffett <kyle@...fetthome.net>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: David Woodhouse <dwmw2@...radead.org>, Ingo Molnar <mingo@...e.hu>,
iommu@...ts.linux-foundation.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] intel-iommu: fix build with CONFIG_BRANCH_TRACER=y
Whoops, resent the original HTML email as plain text, sorry...
On Tue, Apr 7, 2009 at 10:59 AM, Linus Torvalds
<torvalds@...ux-foundation.org> 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@...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