[PATCH] spl: use CONFIG_IS_ENABLED(LOAD_FIT_FULL)

It's possible that LOAD_FIT_FULL will have different values for TPL and SPL, in which case just checking CONFIG_SPL_LOAD_FIT_FULL causes this to be compiled in to the TPL even though functions and struct members it depends on are not.
Use CONFIG_IS_ENABLED() to ensure the correct TPL/SPL variant is checked.
Signed-off-by: John Keeping john@metanate.com --- common/spl/spl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/common/spl/spl.c b/common/spl/spl.c index a0a608fd77..c4019d2bfc 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -198,7 +198,7 @@ void spl_set_header_raw_uboot(struct spl_image_info *spl_image) spl_image->name = "U-Boot"; }
-#ifdef CONFIG_SPL_LOAD_FIT_FULL +#if CONFIG_IS_ENABLED(LOAD_FIT_FULL) /* Parse and load full fitImage in SPL */ static int spl_load_fit_image(struct spl_image_info *spl_image, const struct image_header *header) @@ -305,7 +305,7 @@ __weak int spl_parse_legacy_header(struct spl_image_info *spl_image, int spl_parse_image_header(struct spl_image_info *spl_image, const struct image_header *header) { -#ifdef CONFIG_SPL_LOAD_FIT_FULL +#if CONFIG_IS_ENABLED(LOAD_FIT_FULL) int ret = spl_load_fit_image(spl_image, header);
if (!ret)

On Wed, May 19, 2021 at 10:06 PM John Keeping john@metanate.com wrote:
It's possible that LOAD_FIT_FULL will have different values for TPL and SPL, in which case just checking CONFIG_SPL_LOAD_FIT_FULL causes this to be compiled in to the TPL even though functions and struct members it depends on are not.
Use CONFIG_IS_ENABLED() to ensure the correct TPL/SPL variant is checked.
Signed-off-by: John Keeping john@metanate.com
common/spl/spl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Bin Meng bmeng.cn@gmail.com

On Wed, 19 May 2021 at 08:06, John Keeping john@metanate.com wrote:
It's possible that LOAD_FIT_FULL will have different values for TPL and SPL, in which case just checking CONFIG_SPL_LOAD_FIT_FULL causes this to be compiled in to the TPL even though functions and struct members it depends on are not.
Use CONFIG_IS_ENABLED() to ensure the correct TPL/SPL variant is checked.
Signed-off-by: John Keeping john@metanate.com
common/spl/spl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org

On Wed, May 19, 2021 at 03:05:53PM +0100, John Keeping wrote:
It's possible that LOAD_FIT_FULL will have different values for TPL and SPL, in which case just checking CONFIG_SPL_LOAD_FIT_FULL causes this to be compiled in to the TPL even though functions and struct members it depends on are not.
Use CONFIG_IS_ENABLED() to ensure the correct TPL/SPL variant is checked.
Signed-off-by: John Keeping john@metanate.com Reviewed-by: Bin Meng bmeng.cn@gmail.com Reviewed-by: Simon Glass sjg@chromium.org
Applied to u-boot/master, thanks!
participants (4)
-
Bin Meng
-
John Keeping
-
Simon Glass
-
Tom Rini