[PATCH 5/6] spl: fit: use CONFIG_IS_ENABLED whenever possible
Francesco Valla
francesco at valla.it
Thu Jun 4 22:41:39 CEST 2026
Replace #ifdef directives with the CONFIG_IS_ENABLED() for better
coverage and cleaner code. In the mean time, convert the last
IS_ENABLED() to CONFIG_IS_ENABLED().
Signed-off-by: Francesco Valla <francesco at valla.it>
---
common/spl/spl_fit.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index e1c8b1c9b698..d89384449b38 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -775,7 +775,7 @@ static int spl_simple_fit_parse(struct spl_fit_info *ctx)
if (ctx->conf_node < 0)
return -EINVAL;
- if (IS_ENABLED(CONFIG_SPL_FIT_SIGNATURE)) {
+ if (CONFIG_IS_ENABLED(FIT_SIGNATURE)) {
printf("## Checking hash(es) for config %s ... ",
fit_get_name(ctx->fit, ctx->conf_node, NULL));
if (fit_config_verify(ctx->fit, ctx->conf_node))
@@ -955,9 +955,8 @@ int spl_load_fit_image(struct spl_image_info *spl_image,
int idx, conf_noffset;
int ret;
-#ifdef CONFIG_SPL_FIT_SIGNATURE
- images.verify = 1;
-#endif
+ images.verify = CONFIG_IS_ENABLED(FIT_SIGNATURE);
+
ret = fit_image_load(&images, virt_to_phys((void *)header),
NULL, &fit_uname_config, IH_ARCH_DEFAULT,
IH_TYPE_FIRMWARE, -1, FIT_LOAD_OPTIONAL,
@@ -984,9 +983,8 @@ int spl_load_fit_image(struct spl_image_info *spl_image,
debug(PHASE_PROMPT "payload image: %32s load addr: 0x%lx size: %d\n",
spl_image->name, spl_image->load_addr, spl_image->size);
-#ifdef CONFIG_SPL_FIT_SIGNATURE
- images.verify = 1;
-#endif
+ images.verify = CONFIG_IS_ENABLED(FIT_SIGNATURE);
+
ret = fit_image_load(&images, virt_to_phys((void *)header), NULL,
&fit_uname_config, IH_ARCH_DEFAULT, IH_TYPE_FLATDT,
-1, FIT_LOAD_OPTIONAL, &dt_data, &dt_len);
@@ -1013,9 +1011,8 @@ int spl_load_fit_image(struct spl_image_info *spl_image,
FIT_LOADABLE_PROP, idx,
NULL), uname;
idx++) {
-#ifdef CONFIG_SPL_FIT_SIGNATURE
- images.verify = 1;
-#endif
+ images.verify = CONFIG_IS_ENABLED(FIT_SIGNATURE);
+
ret = fit_image_load(&images, virt_to_phys((void *)header),
&uname, &fit_uname_config,
IH_ARCH_DEFAULT, IH_TYPE_LOADABLE, -1,
--
2.54.0
More information about the U-Boot
mailing list