summaryrefslogtreecommitdiff
path: root/include/linux/compiler-gcc.h
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2010-08-09 17:20:18 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-09 20:45:04 -0700
commitea6b101d8a3ea4e1dec29df31188c2f9852296fe (patch)
treed4ec831d266914d72dbe028388260b8f7dfca6da /include/linux/compiler-gcc.h
parent7387be3373277005c171b9f1509e91fae2e430f3 (diff)
include/linux/compiler-gcc.h: use __same_type() in __must_be_array()
We should use the __same_type() helper in __must_be_array(). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Reported-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/compiler-gcc.h')
-rw-r--r--include/linux/compiler-gcc.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index 0da5b187f124..16508bcddacc 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -35,8 +35,7 @@
(typeof(ptr)) (__ptr + (off)); })
/* &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])))
+#define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
/*
* Force always-inline if the user requests it so via the .config,