[PATCH 10/29] bootm: Reduce arguments to boot_get_kernel()

Tom Rini trini at konsulko.com
Wed Nov 15 23:36:39 CET 2023


On Sat, Nov 11, 2023 at 05:08:55PM -0700, Simon Glass wrote:

> This function only uses one argument and just needs to know the name of
> the command which called it. Adjust the function to use only what it
> needs. This will make it easier to call from a non-command context.
> 
> Tidy up the function comment while we are here.
> 
> Signed-off-by: Simon Glass <sjg at chromium.org>
[snip]
> @@ -312,8 +316,8 @@ static int bootm_find_os(struct cmd_tbl *cmdtp, int flag, int argc,
>  	int ret;
>  
>  	/* get kernel image header, start address and length */
> -	os_hdr = boot_get_kernel(cmdtp, flag, argc, argv,
> -			&images, &images.os.image_start, &images.os.image_len);
> +	os_hdr = boot_get_kernel("bootm", argv[0], &images,
> +				 &images.os.image_start, &images.os.image_len);

Shouldn't this be cmdtp->name not "bootm" ? The eventual use case is
reporting back to the user that what they tried to use with
bootm/booti/bootz isn't a match.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20231115/7dda7aa2/attachment.sig>


More information about the U-Boot mailing list