mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-19 19:34:35 +00:00
x86: zboot: Avoid iteration in do_zboot_states()
Drop the iteration and write out each state in full. This will allow the arguments to be reduced and adjusted in future patches. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
80d4c98757
commit
228c6722d4
1 changed files with 13 additions and 12 deletions
|
@ -136,19 +136,20 @@ U_BOOT_SUBCMDS(zboot,
|
||||||
int do_zboot_states(struct cmd_tbl *cmdtp, int flag, int argc,
|
int do_zboot_states(struct cmd_tbl *cmdtp, int flag, int argc,
|
||||||
char *const argv[], int state_mask)
|
char *const argv[], int state_mask)
|
||||||
{
|
{
|
||||||
int i;
|
int ret;
|
||||||
|
|
||||||
for (i = 0; i < ZBOOT_STATE_COUNT; i++) {
|
if (flag & ZBOOT_STATE_START)
|
||||||
struct cmd_tbl *cmd = &zboot_subcmds[i];
|
ret = do_zboot_start(cmdtp, flag, argc, argv);
|
||||||
int mask = 1 << i;
|
if (!ret && (flag & ZBOOT_STATE_LOAD))
|
||||||
int ret;
|
ret = do_zboot_load(cmdtp, flag, argc, argv);
|
||||||
|
if (!ret && (flag & ZBOOT_STATE_SETUP))
|
||||||
if (mask & state_mask) {
|
ret = do_zboot_setup(cmdtp, flag, argc, argv);
|
||||||
ret = cmd->cmd(cmd, flag, argc, argv);
|
if (!ret && (flag & ZBOOT_STATE_INFO))
|
||||||
if (ret)
|
ret = do_zboot_info(cmdtp, flag, argc, argv);
|
||||||
return ret;
|
if (!ret && (flag & ZBOOT_STATE_GO))
|
||||||
}
|
ret = do_zboot_go(cmdtp, flag, argc, argv);
|
||||||
}
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue