From 2827c2f07d6a5c498262cee7fe78aacfbf44f174 Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Sun, 10 Jul 2022 13:42:55 +0200 Subject: Fix usage of CONFIG_PREBOOT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Due to usage of PREBOOT in Kconfig, macro CONFIG_PREBOOT is always defined when CONFIG_USE_PREBOOT is enabled. In case CONFIG_PREBOOT is not explicitly enabled it is set to empty C string and therefore '#ifdef CONFIG_PREBOOT' guard does not work. Fix this issue by introducing a new Kconfig symbol PREBOOT_DEFINED which cause to define new C macro CONFIG_PREBOOT_DEFINED only when CONFIG_PREBOOT is really defined. Change usage of '#ifdef CONFIG_PREBOOT' by '#ifdef CONFIG_USE_PREBOOT' for code which checks if preboot code would be called and by '#ifdef CONFIG_PREBOOT_DEFINED' for defining preboot code. Signed-off-by: Pali Rohár --- boot/Kconfig | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'boot/Kconfig') diff --git a/boot/Kconfig b/boot/Kconfig index d5c582ebe8..4a001bcee8 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -1492,6 +1492,10 @@ config PREBOOT help This is the default of "preboot" environment variable. +config PREBOOT_DEFINED + bool + default y if PREBOOT != "" + config DEFAULT_FDT_FILE string "Default fdt file" help -- cgit v1.2.3