lkml.org 
[lkml]   [2011]   [Mar]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [tip:core/urgent] WARN_ON_SMP(): Add comment to explain ({0;})
From
Date
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




\
 
 \ /
  Last update: 2011-03-28 17:11    [W:0.041 / U:0.756 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site