Dear Prafulla Wadaskar,

In message <1248804270-13715-1-git-send-email-prafu...@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 <prafu...@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

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
There is a multi-legged creature crawling on your shoulder.
        -- Spock, "A Taste of Armageddon", stardate 3193.9
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to