mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-07 12:49:24 +00:00
bootz: 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:
parent
0c96b6817f
commit
31fda96bb6
1 changed files with 8 additions and 9 deletions
17
cmd/bootz.c
17
cmd/bootz.c
|
@ -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 do_bootz(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||||
{
|
{
|
||||||
int ret;
|
int states, ret;
|
||||||
|
|
||||||
/* Consume 'bootz' */
|
/* Consume 'bootz' */
|
||||||
argc--; argv++;
|
argc--; argv++;
|
||||||
|
@ -79,14 +79,13 @@ int do_bootz(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;
|
||||||
ret = do_bootm_states(cmdtp, flag, argc, argv,
|
|
||||||
#ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH
|
states = BOOTM_STATE_MEASURE | BOOTM_STATE_OS_PREP |
|
||||||
BOOTM_STATE_RAMDISK |
|
BOOTM_STATE_OS_FAKE_GO | BOOTM_STATE_OS_GO;
|
||||||
#endif
|
if (IS_ENABLED(CONFIG_SYS_BOOT_RAMDISK_HIGH))
|
||||||
BOOTM_STATE_MEASURE |
|
states |= BOOTM_STATE_RAMDISK;
|
||||||
BOOTM_STATE_OS_PREP | BOOTM_STATE_OS_FAKE_GO |
|
|
||||||
BOOTM_STATE_OS_GO,
|
ret = do_bootm_states(cmdtp, flag, argc, argv, states, &images, 1);
|
||||||
&images, 1);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue