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

Stephen Warren swarren at wwwdotorg.org
Tue Mar 25 20:03:59 CET 2014


On 03/19/2014 11:58 AM, Przemyslaw Marczak 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.

> diff --git a/lib/uuid.c b/lib/uuid.c

> + * UUID string is 36 length of characters (36 bytes):
> + *
> + * 0        9    14   19   24
> + * xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
> + *    be     be   be   be       be
...
> + * GUID:
>   * 0        9    14   19   24
>   * xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
>   *    le     le   le   be       be
> + *
> + * GUID is used e.g. in GPT (GUID Partition Table) as a partiions unique numbers.

Given that ...

> +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};

Should this actually be named uuid_bin_to_guid_str or guid_bin_to_str?

And "le" doesn't seem like the correct variable name, since it's
actually a mix of 3 LE and 2 BE conversions, isn't it?


More information about the U-Boot mailing list