diff options
| author | Tom Rini <[email protected]> | 2022-05-05 19:37:22 -0400 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2022-05-05 19:37:22 -0400 |
| commit | 03b873b4f41010e4f85a72dd59016bb0b123dde1 (patch) | |
| tree | 3ea6ba397b9ce3db7286537be078944c6daa23b8 /tools | |
| parent | 5d834bfa5fa61dc9dff94a92672c0a1185cb3a83 (diff) | |
| parent | aa5ea20c71921e062aa91d5c7f924cef5d742ec2 (diff) | |
Merge branch '2022-05-05-assorted-cleanups-and-fixes'
- Assorted minor code cleanups.
- Clean-up the reset uclass code slightly and fix some issues with a
lack of handlers for a case in the driver.
- Y2038 RTC fix
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/image-host.c | 2 | ||||
| -rw-r--r-- | tools/imagetool.c | 40 |
2 files changed, 24 insertions, 18 deletions
diff --git a/tools/image-host.c b/tools/image-host.c index ab6f756cf1b..698adfb3e1d 100644 --- a/tools/image-host.c +++ b/tools/image-host.c @@ -1205,7 +1205,7 @@ int fit_pre_load_data(const char *keydir, void *keydest, void *fit) if (!key_name) printf("The property key-name is missing in the node %s\n", IMAGE_PRE_LOAD_PATH); - ret = -ENODATA; + ret = -EINVAL; goto out; } diff --git a/tools/imagetool.c b/tools/imagetool.c index 5ad6d7413fe..f14ca2fb979 100644 --- a/tools/imagetool.c +++ b/tools/imagetool.c @@ -80,27 +80,33 @@ static int imagetool_verify_print_header_by_type( struct image_type_params *tparams, struct image_tool_params *params) { - int retval; - - retval = tparams->verify_header((unsigned char *)ptr, sbuf->st_size, - params); - - if (retval == 0) { - /* - * Print the image information if verify is successful - */ - if (tparams->print_header) { - if (!params->quiet) - tparams->print_header(ptr); + int retval = -1; + + if (tparams->verify_header) { + retval = tparams->verify_header((unsigned char *)ptr, + sbuf->st_size, params); + + if (retval == 0) { + /* + * Print the image information if verify is successful + */ + if (tparams->print_header) { + if (!params->quiet) + tparams->print_header(ptr); + } else { + fprintf(stderr, + "%s: print_header undefined for %s\n", + params->cmdname, tparams->name); + } } else { fprintf(stderr, - "%s: print_header undefined for %s\n", - params->cmdname, tparams->name); + "%s: verify_header failed for %s with exit code %d\n", + params->cmdname, tparams->name, retval); } + } else { - fprintf(stderr, - "%s: verify_header failed for %s with exit code %d\n", - params->cmdname, tparams->name, retval); + fprintf(stderr, "%s: print_header undefined for %s\n", + params->cmdname, tparams->name); } return retval; |
