From a48336e5ea19ca0d32dfff1c4eaeececa8d2f570 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 15 Dec 2023 20:14:13 -0700 Subject: bootm: Adjust arguments of boot_os_fn Adjust boot_os_fn to use struct bootm_info instead of the separate argc, argv and image parameters. Update the handlers accordingly. Few of the functions make use of the arguments, so this improves code size slightly. Signed-off-by: Simon Glass Reviewed-by: Tom Rini --- boot/bootm.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'boot/bootm.c') diff --git a/boot/bootm.c b/boot/bootm.c index 8a0dba5074..f1c45c3806 100644 --- a/boot/bootm.c +++ b/boot/bootm.c @@ -6,6 +6,7 @@ #ifndef USE_HOSTCC #include +#include #include #include #include @@ -1018,6 +1019,7 @@ int do_bootm_states(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[], int states, struct bootm_headers *images, int boot_progress) { + struct bootm_info bmi; boot_os_fn *boot_fn; ulong iflag = 0; int ret = 0, need_boot_fn; @@ -1096,12 +1098,15 @@ int do_bootm_states(struct cmd_tbl *cmdtp, int flag, int argc, return 1; } + bmi.images = images; + bmi.argc = argc; + bmi.argv = argv; /* Call various other states that are not generally used */ if (!ret && (states & BOOTM_STATE_OS_CMDLINE)) - ret = boot_fn(BOOTM_STATE_OS_CMDLINE, argc, argv, images); + ret = boot_fn(BOOTM_STATE_OS_CMDLINE, &bmi); if (!ret && (states & BOOTM_STATE_OS_BD_T)) - ret = boot_fn(BOOTM_STATE_OS_BD_T, argc, argv, images); + ret = boot_fn(BOOTM_STATE_OS_BD_T, &bmi); if (!ret && (states & BOOTM_STATE_OS_PREP)) { ret = bootm_process_cmdline_env(images->os.os == IH_OS_LINUX); if (ret) { @@ -1109,7 +1114,7 @@ int do_bootm_states(struct cmd_tbl *cmdtp, int flag, int argc, ret = CMD_RET_FAILURE; goto err; } - ret = boot_fn(BOOTM_STATE_OS_PREP, argc, argv, images); + ret = boot_fn(BOOTM_STATE_OS_PREP, &bmi); } #ifdef CONFIG_TRACE -- cgit v1.2.3