linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josh Triplett <josh@joshtriplett.org>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND] bug: When !CONFIG_BUG, simplify WARN_ON_ONCE and family
Date: Sat, 22 Feb 2014 14:36:46 -0800	[thread overview]
Message-ID: <20140222223646.GA4931@thin> (raw)
In-Reply-To: <20140222223120.GB4643@thin>

On Sat, Feb 22, 2014 at 02:31:20PM -0800, Josh Triplett wrote:
> On Sat, Feb 22, 2014 at 01:54:49PM -0800, Randy Dunlap wrote:
> > On 02/22/2014 11:23 AM, Josh Triplett wrote:
> > 
> > Hi Josh,
> > 
> > If you redo these patches, please make while(0) not look like a
> > function call, i.e., use while (0) instead.
> 
> Good catch.  Fixing in v2.

Looking at the patch, those while(0)s were all in the original code, not
introduced by my patch.  (diff claims my patch moves them, but a better
diff would have shown that I left them alone and just moved other code
above them.)

With that in mind, I didn't want to change that style issue in the same
patch, but I wrote a separate style patch to be applied on top:

----- >8 -----
From 2a80f851b507f44142d219af3cf00555e333f4c4 Mon Sep 17 00:00:00 2001
From: Josh Triplett <josh@joshtriplett.org>
Date: Sat, 22 Feb 2014 14:33:01 -0800
Subject: [PATCH] include/asm-generic/bug.h: Style fix: s/while(0)/while (0)/

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Josh Triplett <josh@joshtriplett.org>
---
 include/asm-generic/bug.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/asm-generic/bug.h b/include/asm-generic/bug.h
index 34223e0..5f5a277 100644
--- a/include/asm-generic/bug.h
+++ b/include/asm-generic/bug.h
@@ -52,7 +52,7 @@ struct bug_entry {
 #endif
 
 #ifndef HAVE_ARCH_BUG_ON
-#define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while(0)
+#define BUG_ON(condition) do { if (unlikely(condition)) BUG(); } while (0)
 #endif
 
 /*
@@ -138,11 +138,11 @@ extern void warn_slowpath_null(const char *file, const int line);
 
 #else /* !CONFIG_BUG */
 #ifndef HAVE_ARCH_BUG
-#define BUG() do {} while(0)
+#define BUG() do {} while (0)
 #endif
 
 #ifndef HAVE_ARCH_BUG_ON
-#define BUG_ON(condition) do { if (condition) ; } while(0)
+#define BUG_ON(condition) do { if (condition) ; } while (0)
 #endif
 
 #ifndef HAVE_ARCH_WARN_ON
-- 
1.9.0

  reply	other threads:[~2014-02-22 22:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-22 19:23 [PATCH RESEND] bug: When !CONFIG_BUG, simplify WARN_ON_ONCE and family Josh Triplett
2014-02-22 19:23 ` Josh Triplett
2014-02-22 21:54 ` Randy Dunlap
2014-02-22 22:31   ` Josh Triplett
2014-02-22 22:36     ` Josh Triplett [this message]
2014-02-24  8:02 ` Arnd Bergmann
2014-02-24  8:02   ` Arnd Bergmann
2014-02-24  8:44   ` Josh Triplett
2014-02-24  8:44     ` Josh Triplett
2014-02-24  9:35     ` Arnd Bergmann
2014-02-24 12:09   ` David Howells
2014-02-24 12:42     ` Arnd Bergmann
2014-02-24 13:16       ` One Thousand Gnomes
2014-02-24 13:39         ` Arnd Bergmann
2014-02-24 23:17   ` Andrew Morton
2014-02-24 23:17     ` Andrew Morton
2014-02-25  3:06     ` Josh Triplett

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=20140222223646.GA4931@thin \
    --to=josh@joshtriplett.org \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rdunlap@infradead.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;
as well as URLs for NNTP newsgroup(s).