[PATCH 15/29] bootm: Move error printing out of boot_get_kernel()

Tom Rini trini at konsulko.com
Wed Nov 15 23:37:09 CET 2023


On Sat, Nov 11, 2023 at 05:09:00PM -0700, Simon Glass wrote:

> The same error message is printed in two places. Move it out to the
> caller so we can avoid passing in the command name. Leave the bootstage
> handling where it is.
> 
> Signed-off-by: Simon Glass <sjg at chromium.org>
[snip]
> @@ -322,9 +316,12 @@ static int bootm_find_os(struct cmd_tbl *cmdtp, int flag, int argc,
>  	int ret;
>  
>  	/* get kernel image header, start address and length */
> -	ret = boot_get_kernel("bootm", argv[0], &images, &images.os.image_start,
> +	ret = boot_get_kernel(argv[0], &images, &images.os.image_start,
>  			      &images.os.image_len, &os_hdr);
>  	if (ret) {
> +		if (ret == -EPROTOTYPE)
> +			printf("Wrong Image Type for bootm command\n");


This compounds what I said on the earlier patch, yes? Or can we not
actually get here via booti/bootz as their header checking kicks in
earlier?

-- 
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/2e143fe2/attachment.sig>


More information about the U-Boot mailing list