mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: mingo@redhat.com, hpa@zytor.com, linux-kernel@vger.kernel.org,
	dvhart@linux.intel.com, peterz@infradead.org,
	akpm@linux-foundation.org, srostedt@redhat.com,
	tglx@linutronix.de, laijs@cn.fujitsu.com, mingo@elte.hu,
	linux-tip-commits@vger.kernel.org
Subject: Re: [tip:core/urgent] WARN_ON_SMP(): Allow use in if() statements on UP
Date: Fri, 25 Mar 2011 14:16:21 -0400	[thread overview]
Message-ID: <1301076981.14261.197.camel@gandalf.stny.rr.com> (raw)
In-Reply-To: <AANLkTikfq9bz_cKdvq9ab+KS218Q7uVvoNdJeMe_-RUg@mail.gmail.com>

On Fri, 2011-03-25 at 09:45 -0700, Linus Torvalds wrote:
> On Fri, Mar 25, 2011 at 3:48 AM, tip-bot for Steven Rostedt
> <srostedt@redhat.com> wrote:
> > -# define WARN_ON_SMP(x)                        do { } while (0)
> > +# define WARN_ON_SMP(x)                        ({0;})
> 
> That's a VERY odd way of writing "0".
> 
> Am I missing something subtle?

I thought about using "0", but when WARN_ON_SMP() is used outside of an
if statement, it turns into:

	0;

Which seems strange to me. Thus the ({0;}) was basically a way to state
that this is also a function and not just a 0 value.

Also, a quick test shows that

	0;

gives the warning:

	"warning: statement with no effect"

-- Steve



  reply	other threads:[~2011-03-25 18:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-17 19:21 [PATCH 0/2] [GIT PULL] futex: Fix WARN_ON triggering " Steven Rostedt
2011-03-17 19:21 ` [PATCH 1/2] WARN_ON_SMP(): Allow use in if statements " Steven Rostedt
2011-03-17 20:46   ` Darren Hart
2011-03-25  9:35   ` Peter Zijlstra
2011-03-25 10:48   ` [tip:core/urgent] WARN_ON_SMP(): Allow use in if() " tip-bot for Steven Rostedt
2011-03-25 16:45     ` Linus Torvalds
2011-03-25 18:16       ` Steven Rostedt [this message]
2011-03-25 18:19         ` Steven Rostedt
2011-03-25 19:31           ` Alexey Dobriyan
2011-03-25 19:36             ` Steven Rostedt
2011-03-25 19:40             ` Steven Rostedt
2011-03-25 19:47               ` Alexey Dobriyan
2011-03-25 19:53                 ` Steven Rostedt
2011-03-25 19:56                 ` Ingo Molnar
2011-03-17 19:21 ` [PATCH 2/2] futex: Fix WARN_ON() test for UP Steven Rostedt
2011-03-17 20:00   ` Darren Hart
2011-03-25  9:35   ` Peter Zijlstra
2011-03-25 10:49   ` [tip:core/urgent] " tip-bot for Steven Rostedt
2011-03-17 19:27 ` [PATCH 0/2] [GIT PULL] futex: Fix WARN_ON triggering on UP Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1301076981.14261.197.camel@gandalf.stny.rr.com \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=dvhart@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=laijs@cn.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=srostedt@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®