From: Wolfgang Denk Date: Fri, 14 Mar 2014 17:06:48 +0100 Subject: [U-Boot] [PATCH v3 1/3] part_efi: move uuid<->string conversion functions into lib/uuid.c In-Reply-To: <5ef7cdb8df4fb05c3c371e29d7a61e28e1563a68.1394807506.git.p.marczak@samsung.com> References: <72629ef58556732156fadf26a2a48be85704f224.1393600504.git.p.marczak@samsung.com> <5ef7cdb8df4fb05c3c371e29d7a61e28e1563a68.1394807506.git.p.marczak@samsung.com> Message-ID: <20140314160648.E5F6338018C@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 -- 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.