Merge tag 'compiler-attributes-for-linus-v5.4' of git://github.com/ojeda/linux
[sfrench/cifs-2.6.git] / include / linux / compiler_types.h
index b056a40116da9999f66ae5d0efdfe87dc7d3aa7a..72393a8c1a6c5daeab6bb6403252daeb2aecdb93 100644 (file)
@@ -146,8 +146,17 @@ struct ftrace_likely_data {
        __inline_maybe_unused notrace
 #endif
 
        __inline_maybe_unused notrace
 #endif
 
+/*
+ * gcc provides both __inline__ and __inline as alternate spellings of
+ * the inline keyword, though the latter is undocumented. New kernel
+ * code should only use the inline spelling, but some existing code
+ * uses __inline__. Since we #define inline above, to ensure
+ * __inline__ has the same semantics, we need this #define.
+ *
+ * However, the spelling __inline is strictly reserved for referring
+ * to the bare keyword.
+ */
 #define __inline__ inline
 #define __inline__ inline
-#define __inline   inline
 
 /*
  * GCC does not warn about unused static inline functions for -Wunused-function.
 
 /*
  * GCC does not warn about unused static inline functions for -Wunused-function.
@@ -197,6 +206,12 @@ struct ftrace_likely_data {
 #define asm_volatile_goto(x...) asm goto(x)
 #endif
 
 #define asm_volatile_goto(x...) asm goto(x)
 #endif
 
+#ifdef CONFIG_CC_HAS_ASM_INLINE
+#define asm_inline asm __inline
+#else
+#define asm_inline asm
+#endif
+
 #ifndef __no_fgcse
 # define __no_fgcse
 #endif
 #ifndef __no_fgcse
 # define __no_fgcse
 #endif