Subject: [PATCH 1/2] serial: Add flush_buffer() operation to uart_ops
[sfrench/cifs-2.6.git] / include / linux / compiler-gcc.h
index fe23792f05c1077149718fd783458e8d4d12c5db..5c8351b859f03f2fb62c1de00c5150b3e40b8c92 100644 (file)
 #define __must_be_array(a) \
   BUILD_BUG_ON_ZERO(__builtin_types_compatible_p(typeof(a), typeof(&a[0])))
 
-#define inline         inline          __attribute__((always_inline))
-#define __inline__     __inline__      __attribute__((always_inline))
-#define __inline       __inline        __attribute__((always_inline))
+/*
+ * Force always-inline if the user requests it so via the .config,
+ * or if gcc is too old:
+ */
+#if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \
+    !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4)
+# define inline                inline          __attribute__((always_inline))
+# define __inline__    __inline__      __attribute__((always_inline))
+# define __inline      __inline        __attribute__((always_inline))
+#endif
+
 #define __deprecated                   __attribute__((deprecated))
 #define __packed                       __attribute__((packed))
 #define __weak                         __attribute__((weak))