diff options
-rw-r--r-- | boot/bootmeth_cros.c | 2 | ||||
-rw-r--r-- | include/efi.h | 10 | ||||
-rw-r--r-- | include/efi_loader.h | 10 |
3 files changed, 11 insertions, 11 deletions
diff --git a/boot/bootmeth_cros.c b/boot/bootmeth_cros.c index 1d5fd8b193d..676f550ca25 100644 --- a/boot/bootmeth_cros.c +++ b/boot/bootmeth_cros.c @@ -163,7 +163,7 @@ static int scan_part(struct udevice *blk, int partnum, if (uuid_str_to_bin(info->type_guid, type.b, UUID_STR_FORMAT_GUID)) return log_msg_ret("typ", -EINVAL); - if (memcmp(&cros_kern_type, &type, sizeof(type))) + if (guidcmp(&cros_kern_type, &type)) return log_msg_ret("typ", -ENOEXEC); /* Make a buffer for the header information */ diff --git a/include/efi.h b/include/efi.h index c3c4b93f860..d5af2139946 100644 --- a/include/efi.h +++ b/include/efi.h @@ -78,6 +78,16 @@ typedef struct { u8 b[16]; } efi_guid_t __attribute__((aligned(4))); +static inline int guidcmp(const void *g1, const void *g2) +{ + return memcmp(g1, g2, sizeof(efi_guid_t)); +} + +static inline void *guidcpy(void *dst, const void *src) +{ + return memcpy(dst, src, sizeof(efi_guid_t)); +} + #define EFI_BITS_PER_LONG (sizeof(long) * 8) /* Bit mask for EFI status code with error */ diff --git a/include/efi_loader.h b/include/efi_loader.h index 6c993e1a694..ca8fc0820f6 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -21,16 +21,6 @@ struct blk_desc; struct jmp_buf_data; -static inline int guidcmp(const void *g1, const void *g2) -{ - return memcmp(g1, g2, sizeof(efi_guid_t)); -} - -static inline void *guidcpy(void *dst, const void *src) -{ - return memcpy(dst, src, sizeof(efi_guid_t)); -} - #if CONFIG_IS_ENABLED(EFI_LOADER) /** |