diff options
author | Simon Glass <sjg@chromium.org> | 2024-08-22 07:54:52 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2024-08-23 15:58:41 -0600 |
commit | af4ff286ae8dae0f5a3f5bc691ca9dfc3644ef80 (patch) | |
tree | 72f022fe9702bd3a51f59e5f0331912450eee99b | |
parent | 5f64c0c03ae436cc35d72359984709a9164d0381 (diff) | |
download | u-boot-af4ff286ae8dae0f5a3f5bc691ca9dfc3644ef80.tar.gz |
spl: Remove some #ifdefs in spl_parse_image_header()
This function has a number of unnecessary #ifdefs so remove them.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
-rw-r--r-- | common/spl/spl.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/common/spl/spl.c b/common/spl/spl.c index 028cba964fb..f32e62152bf 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -308,8 +308,10 @@ int spl_parse_image_header(struct spl_image_info *spl_image, ret = spl_parse_legacy_header(spl_image, header); if (ret) return ret; - } else { -#ifdef CONFIG_SPL_PANIC_ON_RAW_IMAGE + return 0; + } + + if (IS_ENABLED(CONFIG_SPL_PANIC_ON_RAW_IMAGE)) { /* * CONFIG_SPL_PANIC_ON_RAW_IMAGE is defined when the * code which loads images in SPL cannot guarantee that @@ -319,10 +321,9 @@ int spl_parse_image_header(struct spl_image_info *spl_image, * is bad, and thus should be skipped silently. */ panic("** no mkimage signature but raw image not supported"); -#endif + } -#if CONFIG_IS_ENABLED(OS_BOOT) -#if defined(CONFIG_CMD_BOOTI) + if (CONFIG_IS_ENABLED(OS_BOOT) && IS_ENABLED(CONFIG_CMD_BOOTI)) { ulong start, size; if (!booti_setup((ulong)header, &start, &size, 0)) { @@ -336,7 +337,7 @@ int spl_parse_image_header(struct spl_image_info *spl_image, spl_image->load_addr, spl_image->size); return 0; } -#elif defined(CONFIG_CMD_BOOTZ) + } else if (CONFIG_IS_ENABLED(OS_BOOT) && IS_ENABLED(CONFIG_CMD_BOOTZ)) { ulong start, end; if (!bootz_setup((ulong)header, &start, &end)) { @@ -350,11 +351,11 @@ int spl_parse_image_header(struct spl_image_info *spl_image, spl_image->load_addr, spl_image->size); return 0; } -#endif -#endif + } - if (!spl_parse_board_header(spl_image, bootdev, (const void *)header, sizeof(*header))) - return 0; + if (!spl_parse_board_header(spl_image, bootdev, (const void *)header, + sizeof(*header))) + return 0; #ifdef CONFIG_SPL_RAW_IMAGE_SUPPORT /* Signature not found - assume u-boot.bin */ @@ -366,7 +367,6 @@ int spl_parse_image_header(struct spl_image_info *spl_image, debug("Raw boot image support not enabled, proceeding to other boot methods\n"); return -EINVAL; #endif - } return 0; } |