Skip to contentSkip to conversation

spl: use CONFIG_IS_ENABLED(LOAD_FIT_FULL)

PATCH In review John Keeping 4 participants 4 messages May 19, 2021 – Jul 23, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 common/spl/spl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
common/spl/spl.c +2 -2
index a0a608fd77..c4019d2bfc 100644
@@ -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)
Signature · 1 line
2.31.1
#1 lore raw

PATCH 1/1 spl: use CONFIG_IS_ENABLED(LOAD_FIT_FULL)

Quoted 6 lines · John Keeping

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.

Quoted 8 lines

Use CONFIG_IS_ENABLED() to ensure the correct TPL/SPL variant is checked.

---
 common/spl/spl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
#2 lore raw

PATCH 1/1 spl: use CONFIG_IS_ENABLED(LOAD_FIT_FULL)

In reply to John Keeping
Quoted 6 lines · John Keeping

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.

Quoted 7 lines

Use CONFIG_IS_ENABLED() to ensure the correct TPL/SPL variant is checked.

---
 common/spl/spl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
#3 lore raw
In reply to John Keeping
Quoted 11 lines · John Keeping

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.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom