]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
spl: fit: use CONFIG_IS_ENABLED whenever possible
authorFrancesco Valla <francesco@valla.it>
Thu, 4 Jun 2026 20:41:39 +0000 (22:41 +0200)
committerTom Rini <trini@konsulko.com>
Wed, 17 Jun 2026 20:16:41 +0000 (14:16 -0600)
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@valla.it>
common/spl/spl_fit.c

index e1c8b1c9b6984ed81947e037a724d168c26b5fa1..d89384449b38f652b0ce07b9c42253d2b404826b 100644 (file)
@@ -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,