From mboxrd@z Thu Jan 1 00:00:00 1970 From: Przemyslaw Marczak Date: Mon, 17 Mar 2014 10:15:45 +0100 Subject: [U-Boot] [PATCH v3 1/3] part_efi: move uuid<->string conversion functions into lib/uuid.c In-Reply-To: <20140314160648.E5F6338018C@gemini.denx.de> References: <72629ef58556732156fadf26a2a48be85704f224.1393600504.git.p.marczak@samsung.com> <5ef7cdb8df4fb05c3c371e29d7a61e28e1563a68.1394807506.git.p.marczak@samsung.com> <20140314160648.E5F6338018C@gemini.denx.de> Message-ID: <5326BD41.2080404@samsung.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello, On 03/14/2014 05:06 PM, Wolfgang Denk wrote: > Dear Przemyslaw Marczak, > > In message <5ef7cdb8df4fb05c3c371e29d7a61e28e1563a68.1394807506.git.p.marczak@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 > Right notice, this function should include all inverted operations from uuid_str_to_bin(), I will correct this. Thank you -- Przemyslaw Marczak Samsung R&D Institute Poland Samsung Electronics p.marczak at samsung.com