From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Tue, 25 Mar 2014 13:03:59 -0600 Subject: [U-Boot] [PATCH v4 1/6] part_efi: move uuid<->string conversion functions into lib/uuid.c In-Reply-To: <1395251911-26540-1-git-send-email-p.marczak@samsung.com> References: <5ef7cdb8df4fb05c3c371e29d7a61e28e1563a68.1394807506.git.p.marczak@samsung.com> <1395251911-26540-1-git-send-email-p.marczak@samsung.com> Message-ID: <5331D31F.2090706@wwwdotorg.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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?