diff options
author | Simon Glass <sjg@chromium.org> | 2022-08-28 21:32:48 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-09-14 16:03:06 +0300 |
commit | 0f81af4897e5875faf3c3d676f8140556b7efc36 (patch) | |
tree | 10cbab86475b755272e8cdbb607cb12a23afa4dd /boot/image-board.c | |
parent | 4f2d94129d92c5efd753b486a7c95beb10b53d50 (diff) | |
download | u-boot-0f81af4897e5875faf3c3d676f8140556b7efc36.tar.xz |
image: Drop #ifdefs for LEGACY_IMAGE_FORMAT
Use if() instead of the #ifdef in select_ramdisk().
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'boot/image-board.c')
-rw-r--r-- | boot/image-board.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/boot/image-board.c b/boot/image-board.c index 2d5e5b6e6f..a80ad08b15 100644 --- a/boot/image-board.c +++ b/boot/image-board.c @@ -24,7 +24,6 @@ DECLARE_GLOBAL_DATA_PTR; -#if CONFIG_IS_ENABLED(LEGACY_IMAGE_FORMAT) /** * image_get_ramdisk - get and verify ramdisk image * @rd_addr: ramdisk image start address @@ -83,7 +82,6 @@ static const image_header_t *image_get_ramdisk(ulong rd_addr, u8 arch, return rd_hdr; } -#endif /*****************************************************************************/ /* Shared dual-format routines */ @@ -386,26 +384,25 @@ static int select_ramdisk(bootm_headers_t *images, const char *select, u8 arch, */ buf = map_sysmem(rd_addr, 0); switch (genimg_get_format(buf)) { -#if CONFIG_IS_ENABLED(LEGACY_IMAGE_FORMAT) - case IMAGE_FORMAT_LEGACY: { - const image_header_t *rd_hdr; + case IMAGE_FORMAT_LEGACY: + if (CONFIG_IS_ENABLED(LEGACY_IMAGE_FORMAT)) { + const image_header_t *rd_hdr; - printf("## Loading init Ramdisk from Legacy Image at %08lx ...\n", - rd_addr); + printf("## Loading init Ramdisk from Legacy Image at %08lx ...\n", + rd_addr); - bootstage_mark(BOOTSTAGE_ID_CHECK_RAMDISK); - rd_hdr = image_get_ramdisk(rd_addr, arch, - images->verify); + bootstage_mark(BOOTSTAGE_ID_CHECK_RAMDISK); + rd_hdr = image_get_ramdisk(rd_addr, arch, + images->verify); - if (!rd_hdr) - return -ENOENT; + if (!rd_hdr) + return -ENOENT; - *rd_datap = image_get_data(rd_hdr); - *rd_lenp = image_get_data_size(rd_hdr); - done = true; + *rd_datap = image_get_data(rd_hdr); + *rd_lenp = image_get_data_size(rd_hdr); + done = true; + } break; - } -#endif #if CONFIG_IS_ENABLED(FIT) case IMAGE_FORMAT_FIT: rd_noffset = fit_image_load(images, |