booti: Avoid use of #ifdef
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>
This commit is contained in:
24
cmd/booti.c
24
cmd/booti.c
@@ -105,6 +105,7 @@ static int booti_start(struct cmd_tbl *cmdtp, int flag, int argc,
|
|||||||
|
|
||||||
int do_booti(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
int do_booti(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||||
{
|
{
|
||||||
|
int states;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* Consume 'booti' */
|
/* Consume 'booti' */
|
||||||
@@ -120,19 +121,16 @@ int do_booti(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
|||||||
bootm_disable_interrupts();
|
bootm_disable_interrupts();
|
||||||
|
|
||||||
images.os.os = IH_OS_LINUX;
|
images.os.os = IH_OS_LINUX;
|
||||||
#ifdef CONFIG_RISCV_SMODE
|
if (IS_ENABLED(CONFIG_RISCV_SMODE))
|
||||||
images.os.arch = IH_ARCH_RISCV;
|
images.os.arch = IH_ARCH_RISCV;
|
||||||
#elif CONFIG_ARM64
|
else if (IS_ENABLED(CONFIG_ARM64))
|
||||||
images.os.arch = IH_ARCH_ARM64;
|
images.os.arch = IH_ARCH_ARM64;
|
||||||
#endif
|
|
||||||
ret = do_bootm_states(cmdtp, flag, argc, argv,
|
states = BOOTM_STATE_MEASURE | BOOTM_STATE_OS_PREP |
|
||||||
#ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH
|
BOOTM_STATE_OS_FAKE_GO | BOOTM_STATE_OS_GO;
|
||||||
BOOTM_STATE_RAMDISK |
|
if (IS_ENABLED(CONFIG_SYS_BOOT_RAMDISK_HIGH))
|
||||||
#endif
|
states |= BOOTM_STATE_RAMDISK;
|
||||||
BOOTM_STATE_MEASURE |
|
ret = do_bootm_states(cmdtp, flag, argc, argv, states, &images, 1);
|
||||||
BOOTM_STATE_OS_PREP | BOOTM_STATE_OS_FAKE_GO |
|
|
||||||
BOOTM_STATE_OS_GO,
|
|
||||||
&images, 1);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user