diff mbox series

[U-Boot] mkimage: do not fail if there is no print_header function

Message ID 20180330082819.11100-1-guillaume.gardet@free.fr
State Accepted
Commit 004d00914a1888a050ef2d30e52e8e3862983ccb
Delegated to: Tom Rini
Headers show
Series [U-Boot] mkimage: do not fail if there is no print_header function | expand

Commit Message

Guillaume GARDET March 30, 2018, 8:28 a.m. UTC
Commit 253c60a breaks the exit value of 'mkimage -T rkimage'
and print the following  error:
  mkimage: Can't print header for Rockchip Boot Image support: Success

It is not a failure to not print headers, so just display the warning message,
and finish the function properly.

Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>

Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
---
 tools/mkimage.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Philipp Tomsich March 30, 2018, 8:46 a.m. UTC | #1
> On 30 Mar 2018, at 10:28, Guillaume GARDET <guillaume.gardet@free.fr> wrote:
> 
> Commit 253c60a breaks the exit value of 'mkimage -T rkimage'
> and print the following  error:
>  mkimage: Can't print header for Rockchip Boot Image support: Success
> 
> It is not a failure to not print headers, so just display the warning message,
> and finish the function properly.
> 
> Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>

Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

> Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Tom Rini <trini@konsulko.com>
> ---
> tools/mkimage.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/mkimage.c b/tools/mkimage.c
> index 28ff35e670..4e561820e7 100644
> --- a/tools/mkimage.c
> +++ b/tools/mkimage.c
> @@ -588,9 +588,8 @@ int main(int argc, char **argv)
> 	if (tparams->print_header)
> 		tparams->print_header (ptr);
> 	else {
> -		fprintf (stderr, "%s: Can't print header for %s: %s\n",
> -			params.cmdname, tparams->name, strerror(errno));
> -		exit (EXIT_FAILURE);
> +		fprintf (stderr, "%s: Can't print header for %s\n",
> +			params.cmdname, tparams->name);
> 	}
> 
> 	(void) munmap((void *)ptr, sbuf.st_size);
> -- 
> 2.13.6
>
Tom Rini April 11, 2018, 2:04 p.m. UTC | #2
On Fri, Mar 30, 2018 at 10:28:19AM +0200, Guillaume GARDET wrote:

> Commit 253c60a breaks the exit value of 'mkimage -T rkimage'
> and print the following  error:
>   mkimage: Can't print header for Rockchip Boot Image support: Success
> 
> It is not a failure to not print headers, so just display the warning message,
> and finish the function properly.
> 
> Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
> 
> Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> Cc: Simon Glass <sjg@chromium.org>
> Cc: Tom Rini <trini@konsulko.com>
> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/tools/mkimage.c b/tools/mkimage.c
index 28ff35e670..4e561820e7 100644
--- a/tools/mkimage.c
+++ b/tools/mkimage.c
@@ -588,9 +588,8 @@  int main(int argc, char **argv)
 	if (tparams->print_header)
 		tparams->print_header (ptr);
 	else {
-		fprintf (stderr, "%s: Can't print header for %s: %s\n",
-			params.cmdname, tparams->name, strerror(errno));
-		exit (EXIT_FAILURE);
+		fprintf (stderr, "%s: Can't print header for %s\n",
+			params.cmdname, tparams->name);
 	}
 
 	(void) munmap((void *)ptr, sbuf.st_size);