public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] BUILD_BUG_ON_ZERO -> BUILD_BUG_OR_ZERO
@ 2007-03-11 23:28 Rusty Russell
  2007-03-12  8:23 ` Jan Beulich
  2007-03-12  9:42 ` Andi Kleen
  0 siblings, 2 replies; 9+ messages in thread
From: Rusty Russell @ 2007-03-11 23:28 UTC (permalink / raw)
  To: lkml - Kernel Mailing List; +Cc: Andi Kleen, Jan Beulich

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__						\



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-03-12 22:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-11 23:28 [PATCH] BUILD_BUG_ON_ZERO -> BUILD_BUG_OR_ZERO Rusty Russell
2007-03-12  8:23 ` Jan Beulich
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox