This option is enabled by default for U-Boot.
+config OPTIMIZE_INLINING
+ bool "Allow compiler to uninline functions marked 'inline'"
+ default n
+ help
+ This option determines if U-Boot forces gcc to inline the functions
+ developers have marked 'inline'. Doing so takes away freedom from gcc to
+ do what it thinks is best, which is desirable in some cases for size
+ reasons.
+
config CC_COVERAGE
bool "Enable code coverage analysis"
depends on SANDBOX
#define __compiler_offsetof(a, b) __builtin_offsetof(a, b)
/*
+ * Force always-inline if the user requests it so via the .config.
* Prefer gnu_inline, so that extern inline functions do not emit an
* externally visible function. This makes extern inline behave as per gnu89
* semantics rather than c99. This prevents multiple symbol definition errors
* of extern inline functions at link time.
* A lot of inline functions can cause havoc with function tracing.
+ * Do not use __always_inline here, since currently it expands to inline again
+ * (which would break users of __always_inline).
*/
-#define inline inline __gnu_inline __inline_maybe_unused notrace
+#if !defined(CONFIG_OPTIMIZE_INLINING)
+#define inline inline __attribute__((__always_inline__)) __gnu_inline \
+ __inline_maybe_unused notrace
+#else
+#define inline inline __gnu_inline \
+ __inline_maybe_unused notrace
+#endif
/*
* gcc provides both __inline__ and __inline as alternate spellings of