[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1301324940.14261.232.camel@gandalf.stny.rr.com>
Date: Mon, 28 Mar 2011 11:09:00 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: "H. Peter Anvin" <hpa@...or.com>
Cc: richard -rw- weinberger <richard.weinberger@...il.com>,
linux-kernel@...r.kernel.org, mingo@...hat.com,
torvalds@...ux-foundation.org, srostedt@...hat.com,
tglx@...utronix.de, adobriyan@...il.com,
linux-tip-commits@...r.kernel.org
Subject: Re: [tip:core/urgent] WARN_ON_SMP(): Add comment to explain ({0;})
On Mon, 2011-03-28 at 07:58 -0700, H. Peter Anvin wrote:
> On 03/28/2011 07:56 AM, richard -rw- weinberger wrote:
> >>
> >> What the heck is wrong with the idiomatic and non-gcc-extension-using:
> >>
> >> ((void)0)
> >>
> >> ?
> >
> > AFAIK you cannot use it within an if-statement.
> >
>
> OK, fair enough.
If people hate the ({0;}) so much, we could replace it with:
static inline int _WARN_ON_SMP(void) { return 0; }
#define WARN_ON_SMP(x) _WARN_ON_SMP()
That would pretty much do the same thing.
o Keeps the parameters from being evaluated, as they may not be defined
for SMP
o Can be used as a standalone statement without gcc complaining
o Can be used within an if condition.
Geeze, I never expected such a fuss over a simple change ;)
-- Steve
--
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