@@ -8,7 +8,6 @@
#include <linux/ctype.h>
#include <errno.h>
#include <common.h>
-#include <asm/io.h>
#include <part_efi.h>
#include <malloc.h>
@@ -278,13 +277,13 @@ void gen_rand_uuid(unsigned char *uuid_bin)
for (i = 0; i < sizeof(struct uuid) / sizeof(*ptr); i++)
*(ptr + i) = cpu_to_be32(rand());
- clrsetbits_be16(&uuid.time_hi_and_version,
- UUID_VERSION_MASK,
- UUID_VERSION << UUID_VERSION_SHIFT);
+ /* UUID is big endian */
+ uuid.time_hi_and_version |= ~cpu_to_be16(UUID_VERSION_MASK);
+ uuid.time_hi_and_version &=
+ cpu_to_be16(UUID_VERSION << UUID_VERSION_SHIFT);
- clrsetbits_8(&uuid.clock_seq_hi_and_reserved,
- UUID_VARIANT_MASK,
- UUID_VARIANT << UUID_VARIANT_SHIFT);
+ uuid.clock_seq_hi_and_reserved |= ~UUID_VARIANT_MASK;
+ uuid.clock_seq_hi_and_reserved &= UUID_VARIANT << UUID_VARIANT_SHIFT;
memcpy(uuid_bin, &uuid, sizeof(struct uuid));
}
io.h is only used for CONFIG_RANDOM_UUID - for clrsetbits_be16 - for clrsetbits_8 available only for some target (but not for SANDBOX) Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> --- Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None lib/uuid.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)