All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <jbeulich@novell.com>
To: "Rusty Russell" <rusty@rustcorp.com.au>
Cc: "Andi Kleen" <ak@muc.de>,
	"lkml - Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] BUILD_BUG_ON_ZERO -> BUILD_BUG_OR_ZERO
Date: Mon, 12 Mar 2007 08:23:49 +0000	[thread overview]
Message-ID: <45F51C25.76E4.0078.0@novell.com> (raw)
In-Reply-To: <1173655694.32234.213.camel@localhost.localdomain>

I have to admit that I don't see the point here - I can't seem to make any sense of the OR... Jan

>>> Rusty Russell <rusty@rustcorp.com.au> 12.03.07 00:28 >>>
BUILD_BUG_ON_ZERO is named perfectly wrong, and BUILD_BUG_ON_RETURN_ZERO
is too long.  Flip three bits, and the name is much more suitable.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

diff -r 6fb745a5bb51 include/linux/compiler-gcc.h
--- a/include/linux/compiler-gcc.h	Mon Mar 12 09:12:20 2007 +1100
+++ b/include/linux/compiler-gcc.h	Mon Mar 12 09:51:18 2007 +1100
@@ -24,7 +24,7 @@
 
 /* &a[0] degrades to a pointer: a different type from an array */
 #define __must_be_array(a) \
-  BUILD_BUG_ON_ZERO(__builtin_types_compatible_p(typeof(a), typeof(&a[0])))
+  BUILD_BUG_OR_ZERO(__builtin_types_compatible_p(typeof(a), typeof(&a[0])))
 
 #define inline		inline		__attribute__((always_inline))
 #define __inline__	__inline__	__attribute__((always_inline))
diff -r 6fb745a5bb51 include/linux/kernel.h
--- a/include/linux/kernel.h	Mon Mar 12 09:12:20 2007 +1100
+++ b/include/linux/kernel.h	Mon Mar 12 09:51:25 2007 +1100
@@ -341,7 +341,7 @@ struct sysinfo {
    result (of value 0 and type size_t), so the expression can be used
    e.g. in a structure initializer (or where-ever else comma expressions
    aren't permitted). */
-#define BUILD_BUG_ON_ZERO(e) (sizeof(char[1 - 2 * !!(e)]) - 1)
+#define BUILD_BUG_OR_ZERO(e) (sizeof(char[1 - 2 * !!(e)]) - 1)
 
 /* Trap pasters of __FUNCTION__ at compile-time */
 #define __FUNCTION__ (__func__)
diff -r 6fb745a5bb51 include/linux/moduleparam.h
--- a/include/linux/moduleparam.h	Mon Mar 12 09:12:20 2007 +1100
+++ b/include/linux/moduleparam.h	Mon Mar 12 09:51:42 2007 +1100
@@ -65,7 +65,7 @@ struct kparam_array
 #define __module_param_call(prefix, name, set, get, arg, perm)		\
 	/* Default value instead of permissions? */			\
 	static int __param_perm_check_##name __attribute__((unused)) =	\
-	BUILD_BUG_ON_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2));	\
+	BUILD_BUG_OR_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2));	\
 	static char __param_str_##name[] = prefix #name;		\
 	static struct kernel_param const __param_##name			\
 	__attribute_used__						\



  reply	other threads:[~2007-03-12  8:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-11 23:28 [PATCH] BUILD_BUG_ON_ZERO -> BUILD_BUG_OR_ZERO Rusty Russell
2007-03-12  8:23 ` Jan Beulich [this message]
2007-03-12  8:39   ` Jan Engelhardt
2007-03-12  9:25   ` Rusty Russell
2007-03-12 11:41     ` Stefan Richter
2007-03-12 11:49       ` Robert P. J. Day
2007-03-12 14:14         ` Stefan Richter
2007-03-12 22:25           ` Rusty Russell
2007-03-12  9:42 ` Andi Kleen

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=45F51C25.76E4.0078.0@novell.com \
    --to=jbeulich@novell.com \
    --cc=ak@muc.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.