Patchwork [U-Boot] image: Use ENOENT instead of ENOMEDIUM for better compatibility

login
register
mail settings
Submitter Simon Glass
Date June 16, 2013, 2:46 p.m.
Message ID <1371394009-21590-1-git-send-email-sjg@chromium.org>
Download mbox | patch
Permalink /patch/251685/
State Accepted
Delegated to: Tom Rini
Headers show

Comments

Simon Glass - June 16, 2013, 2:46 p.m.
This error may not be defined on some platforms such as MacOS so host
compilation will fail. Use one of the more common errors instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
 common/image-fit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Jeroen Hofstee - June 16, 2013, 5:17 p.m.
Hello Simon,

On 06/16/2013 04:46 PM, Simon Glass wrote:
> This error may not be defined on some platforms such as MacOS so host
> compilation will fail. Use one of the more common errors instead.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
>
> ---
> common/image-fit.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/common/image-fit.c b/common/image-fit.c
> index 7bf82d3..f40f160 100644
> --- a/common/image-fit.c
> +++ b/common/image-fit.c
> @@ -1557,7 +1557,7 @@ int fit_image_load(bootm_headers_t *images, const char *prop_name, ulong addr,
>   	if (fit_image_get_data(fit, noffset, &buf, &size)) {
>   		printf("Could not find %s subimage data!\n", prop_name);
>   		bootstage_error(bootstage_id + BOOTSTAGE_SUB_GET_DATA);
> -		return -ENOMEDIUM;
> +		return -ENOENT;
>   	}
>   	len = (ulong)size;
>   
This fixes building for FreeBSD as well, thanks.

Regards,
Jeroen
Andreas Bießmann - June 17, 2013, 6:34 a.m.
On 16.06.13 16:46, Simon Glass wrote:
> This error may not be defined on some platforms such as MacOS so host
> compilation will fail. Use one of the more common errors instead.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Tested-by: Andreas Bießmann <andreas.devel@googlemail.com>

on OS X 10.7.5
Lubomir Popov - June 17, 2013, 7:04 a.m.
On 16.06.2013 17:46, Simon Glass wrote:
> This error may not be defined on some platforms such as MacOS so host
> compilation will fail. Use one of the more common errors instead.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>

Tested-by: Lubomir Popov <lpopov@mm-sol.com>

on MacOS X 10.8.3 with the following tools used for building U-Boot:

arm-none-eabi-gcc (GCC) 4.7.2
GNU ld (GNU Binutils) 2.23.1
Tom Rini - June 17, 2013, 1:57 p.m.
On Sun, Jun 16, 2013 at 07:46:49AM -0700, Simon Glass wrote:

> This error may not be defined on some platforms such as MacOS so host
> compilation will fail. Use one of the more common errors instead.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!

Patch

diff --git a/common/image-fit.c b/common/image-fit.c
index 7bf82d3..f40f160 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -1557,7 +1557,7 @@  int fit_image_load(bootm_headers_t *images, const char *prop_name, ulong addr,
 	if (fit_image_get_data(fit, noffset, &buf, &size)) {
 		printf("Could not find %s subimage data!\n", prop_name);
 		bootstage_error(bootstage_id + BOOTSTAGE_SUB_GET_DATA);
-		return -ENOMEDIUM;
+		return -ENOENT;
 	}
 	len = (ulong)size;