aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/compiler-clang.h1
-rw-r--r--include/linux/compiler-gcc.h7
-rw-r--r--include/linux/compiler-intel.h3
-rw-r--r--include/linux/compiler.h7
4 files changed, 7 insertions, 11 deletions
diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h
index d11cad61ba5c..fa9532f8d885 100644
--- a/include/linux/compiler-clang.h
+++ b/include/linux/compiler-clang.h
@@ -41,6 +41,5 @@
41 * compilers, like ICC. 41 * compilers, like ICC.
42 */ 42 */
43#define barrier() __asm__ __volatile__("" : : : "memory") 43#define barrier() __asm__ __volatile__("" : : : "memory")
44#define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
45#define __assume_aligned(a, ...) \ 44#define __assume_aligned(a, ...) \
46 __attribute__((__assume_aligned__(a, ## __VA_ARGS__))) 45 __attribute__((__assume_aligned__(a, ## __VA_ARGS__)))
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index 7a1de7683df5..3b32bbfa5a49 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -68,13 +68,6 @@
68 */ 68 */
69#define uninitialized_var(x) x = x 69#define uninitialized_var(x) x = x
70 70
71#ifdef __CHECKER__
72#define __must_be_array(a) 0
73#else
74/* &a[0] degrades to a pointer: a different type from an array */
75#define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
76#endif
77
78#ifdef RETPOLINE 71#ifdef RETPOLINE
79#define __noretpoline __attribute__((__indirect_branch__("keep"))) 72#define __noretpoline __attribute__((__indirect_branch__("keep")))
80#endif 73#endif
diff --git a/include/linux/compiler-intel.h b/include/linux/compiler-intel.h
index fef8bb3e53ef..6004b4588bd4 100644
--- a/include/linux/compiler-intel.h
+++ b/include/linux/compiler-intel.h
@@ -29,9 +29,6 @@
29 */ 29 */
30#define OPTIMIZER_HIDE_VAR(var) barrier() 30#define OPTIMIZER_HIDE_VAR(var) barrier()
31 31
32/* Intel ECC compiler doesn't support __builtin_types_compatible_p() */
33#define __must_be_array(a) 0
34
35#endif 32#endif
36 33
37/* icc has this, but it's called _bswap16 */ 34/* icc has this, but it's called _bswap16 */
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index ec4a28bad2c6..165b1d5683ed 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -357,4 +357,11 @@ static inline void *offset_to_ptr(const int *off)
357 compiletime_assert(__native_word(t), \ 357 compiletime_assert(__native_word(t), \
358 "Need native word sized stores/loads for atomicity.") 358 "Need native word sized stores/loads for atomicity.")
359 359
360#ifdef __CHECKER__
361#define __must_be_array(a) 0
362#else
363/* &a[0] degrades to a pointer: a different type from an array */
364#define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
365#endif
366
360#endif /* __LINUX_COMPILER_H */ 367#endif /* __LINUX_COMPILER_H */