summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-26 18:48:52 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-26 18:48:52 +0200
commitd485cb9aa2e302fac7e7fb586a0cb4c0a5211be9 (patch)
tree1dd01f33dc1d77bcc0417497bd1af1c642f6e16d /include
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6 (diff)
parentgeneric: make optimized inlining arch-opt-in (diff)
downloadlinux-d485cb9aa2e302fac7e7fb586a0cb4c0a5211be9.tar.xz
linux-d485cb9aa2e302fac7e7fb586a0cb4c0a5211be9.zip
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86-optimized-inlining
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86-optimized-inlining: generic: make optimized inlining arch-opt-in x86: add optimized inlining
Diffstat (limited to 'include')
-rw-r--r--include/linux/compiler-gcc.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index fe23792f05c1..b2fd7547b58d 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -28,9 +28,16 @@
#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:
+ */
+#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))