Commit ea6b101d authored by Rusty Russell's avatar Rusty Russell Committed by Linus Torvalds

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: default avatarRusty Russell <rusty@rustcorp.com.au>
Reported-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 7387be33
......@@ -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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment