From patchwork Thu May 14 12:30:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rini X-Patchwork-Id: 245810 List-Id: U-Boot discussion From: trini at konsulko.com (Tom Rini) Date: Thu, 14 May 2020 08:30:08 -0400 Subject: [PATCH 09/10] compilers: Introduce options for forcing inlining on SPL/TPL In-Reply-To: <20200514123009.5721-1-trini@konsulko.com> References: <20200514123009.5721-1-trini@konsulko.com> Message-ID: <20200514123009.5721-9-trini@konsulko.com> There are cases where when we allow the compiler to decide about making inline decisions rather than forcing them it can save us space. For now, we keep the default values for inlining that we have had historically. Cc: Masahiro Yamada Signed-off-by: Tom Rini --- Kconfig | 22 +++++++++++++++++++++- include/linux/compiler_types.h | 2 +- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Kconfig b/Kconfig index b582db24f5d0..f23c07da6819 100644 --- a/Kconfig +++ b/Kconfig @@ -65,7 +65,27 @@ config CC_OPTIMIZE_FOR_SIZE This option is enabled by default for U-Boot. config OPTIMIZE_INLINING - bool "Allow compiler to uninline functions marked 'inline'" + bool "Allow compiler to uninline functions marked 'inline' in full U-Boot" + 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 SPL_OPTIMIZE_INLINING + bool "Allow compiler to uninline functions marked 'inline' in SPL" + depends on SPL + 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 TPL_OPTIMIZE_INLINING + bool "Allow compiler to uninline functions marked 'inline' in TPL" + depends on TPL default n help This option determines if U-Boot forces gcc to inline the functions diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h index 72393a8c1a6c..1a3060117f14 100644 --- a/include/linux/compiler_types.h +++ b/include/linux/compiler_types.h @@ -138,7 +138,7 @@ struct ftrace_likely_data { * Do not use __always_inline here, since currently it expands to inline again * (which would break users of __always_inline). */ -#if !defined(CONFIG_OPTIMIZE_INLINING) +#if !CONFIG_IS_ENABLED(OPTIMIZE_INLINING) #define inline inline __attribute__((__always_inline__)) __gnu_inline \ __inline_maybe_unused notrace #else