]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
bootz: Avoid use of #ifdef
authorSimon Glass <sjg@chromium.org>
Sat, 16 Dec 2023 03:14:17 +0000 (20:14 -0700)
committerTom Rini <trini@konsulko.com>
Thu, 21 Dec 2023 21:07:52 +0000 (16:07 -0500)
Use the compiler to get the set of states, instead of the preprocessor.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
cmd/bootz.c

index a652879ea5ece5e3cb983f63904cc552f93bea83..8c25905598a815962103d96b951c440099f9e258 100644 (file)
@@ -64,7 +64,7 @@ static int bootz_start(struct cmd_tbl *cmdtp, int flag, int argc,
 
 int do_bootz(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 {
-       int ret;
+       int states, ret;
 
        /* Consume 'bootz' */
        argc--; argv++;
@@ -79,14 +79,13 @@ int do_bootz(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
        bootm_disable_interrupts();
 
        images.os.os = IH_OS_LINUX;
-       ret = do_bootm_states(cmdtp, flag, argc, argv,
-#ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH
-                             BOOTM_STATE_RAMDISK |
-#endif
-                             BOOTM_STATE_MEASURE |
-                             BOOTM_STATE_OS_PREP | BOOTM_STATE_OS_FAKE_GO |
-                             BOOTM_STATE_OS_GO,
-                             &images, 1);
+
+       states = BOOTM_STATE_MEASURE | BOOTM_STATE_OS_PREP |
+               BOOTM_STATE_OS_FAKE_GO | BOOTM_STATE_OS_GO;
+       if (IS_ENABLED(CONFIG_SYS_BOOT_RAMDISK_HIGH))
+               states |= BOOTM_STATE_RAMDISK;
+
+       ret = do_bootm_states(cmdtp, flag, argc, argv, states, &images, 1);
 
        return ret;
 }