
Dear Prafulla Wadaskar,
In message 1248804270-13715-1-git-send-email-prafulla@marvell.com you wrote:
List command always return "EXIT_SUCCESS" even in case of failure by any means.
This patch return 0 if list command is sucessful, returns negative value reported by check_header functions
Signed-off-by: Prafulla Wadaskar prafulla@marvell.com
tools/mkimage.c | 27 +++++++++++++-------------- 1 files changed, 13 insertions(+), 14 deletions(-)
Just a minor nitpick:
...
if (fdt_check_header (ptr)) {
/* old-style image */
image_verify_header ((char *)ptr, sbuf.st_size);
image_print_contents ((image_header_t *)ptr);
} else {
/* FIT image */
if (!(retval = fdt_check_header (ptr))) /* FIT image */ fit_print_contents (ptr);
}
else if (!(retval = image_verify_header (
(char *)ptr, sbuf.st_size))) /* old-style image */
image_print_contents ((image_header_t *)ptr);
The resulting code looks ugly to me. Please write as:
if (!(retval = fdt_check_header(ptr))) { /* FIT image */ fit_print_contents (ptr); } else if (!(retval = image_verify_header((char *)ptr, sbuf.st_size))) { /* old-style image */ image_print_contents ((image_header_t *)ptr); }
Thanks.
Best regards,
Wolfgang Denk