From: Rusty Russell Date: Tue, 10 Aug 2010 00:20:18 +0000 (-0700) Subject: include/linux/compiler-gcc.h: use __same_type() in __must_be_array() X-Git-Tag: v2.6.36-rc1~379 X-Git-Url: https://bbs.cooldavid.org/git/?a=commitdiff_plain;h=ea6b101d8a3ea4e1dec29df31188c2f9852296fe;p=net-next-2.6.git 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 Reported-by: Andrew Morton Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index 0da5b187f12..16508bcddac 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,