[U-Boot] [PATCH v3 1/3] part_efi: move uuid<->string conversion functions into lib/uuid.c

Wolfgang Denk wd at denx.de
Fri Mar 14 17:06:48 CET 2014


Dear Przemyslaw Marczak,

In message <5ef7cdb8df4fb05c3c371e29d7a61e28e1563a68.1394807506.git.p.marczak at samsung.com> you wrote:
> Changes:
> - move uuid<->string conversion functions into lib/uuid.c so they can be
>   used by code outside part_efi.c.
> - rename uuid_string() to uuid_bin_to_str() for consistency with existing
>   uuid_str_to_bin()
> - add an error return code to uuid_str_to_bin()
> 
> Update existing code to the new library functions.
...
> +void uuid_bin_to_str(unsigned char *uuid, char *str)
> +{
> +	static const u8 le[16] = {3, 2, 1, 0, 5, 4, 7, 6, 8, 9, 10, 11,
> +				  12, 13, 14, 15};
> +	int i;
> +
> +	for (i = 0; i < 16; i++) {
> +		sprintf(str, "%02x", uuid[le[i]]);

You mentioned before that the UUID format was big endian.  Hoever,
here you always use trhe same byte order 3-2-1-0 when formatting the
initi "int" field - you do not take into account whether this code is
running on a BE or a LE system.  Is this code not only correct for LE
systems, but broken when running on a BE machine?

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: wd at denx.de
Of course there's no reason for it, it's just our policy.


More information about the U-Boot mailing list