Dear Heinrich,

In message <20171123215901.8992-1-xypron.g...@gmx.de> you wrote:
>
> +#ifdef CONFIG_EFI_LOADER
> +static char *device_path_string(char *buf, char *end, void *dp, int 
> field_width,
> +                             int precision, int flags)
> +{
> +     u16 *str = efi_dp_str((struct efi_device_path *)dp);
> +
> +     /* Do not silently ignore out of memory situation */
> +     if (!str && dp)
> +             panic("efi_dp_str: out of memory");
> +
> +     buf = string16(buf, end, str, field_width, precision, flags);
> +     efi_free_pool(str);
> +     return buf;
> +}

I think this would be much clearer if you wrote:

        u16 *str;

        if (dp == NULL)
                return "<NULL>";

        str = efi_dp_str((struct efi_device_path *)dp);

        if (str == NULL)
                panic("device_path_string(): out of memory");

        buf = string16(buf, end, str, field_width, precision, flags);
        efi_free_pool(str); 
        return buf;

Thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
grep me no patterns and I'll tell you no lines.
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to