From: Ahmad Fatoum <ahmad@a3f.at>
To: barebox@lists.infradead.org
Subject: [PATCH 2/5] efi: retire efi_compare_guid in favor of efi_guidcmp
Date: Wed, 16 Oct 2019 09:21:36 +0200 [thread overview]
Message-ID: <20191016072139.2323-2-ahmad@a3f.at> (raw)
In-Reply-To: <20191016072139.2323-1-ahmad@a3f.at>
Both functions wrap the same memcmp except that one uses pointers to
GUIDs and the other passes the GUIDs by value.
The function is static inline, so it doesn't really matter which one we
keep. We'll drop efi_compare_guid because it's been used once only in the
code base so far.
Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
common/efi-devicepath.c | 2 +-
include/efi.h | 5 -----
2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/common/efi-devicepath.c b/common/efi-devicepath.c
index 24722284b4a7..3db2cea061ca 100644
--- a/common/efi-devicepath.c
+++ b/common/efi-devicepath.c
@@ -572,7 +572,7 @@ dev_path_vendor(struct string *str, void *dev_path)
}
cprintf(str, "Ven%s(%pU", type, &Vendor->Guid);
- if (efi_compare_guid(&Vendor->Guid, &efi_unknown_device_guid) == 0) {
+ if (efi_guidcmp(Vendor->Guid, efi_unknown_device_guid) == 0) {
/* GUID used by EFI to enumerate an EDD 1.1 device */
unknown_dev_path =
(struct unknown_device_vendor_device_path *) Vendor;
diff --git a/include/efi.h b/include/efi.h
index 218333f82426..166803a58f39 100644
--- a/include/efi.h
+++ b/include/efi.h
@@ -664,11 +664,6 @@ typedef union {
efi_ipv6_address v6;
} efi_ip_address;
-static inline int efi_compare_guid(efi_guid_t *a, efi_guid_t *b)
-{
- return memcmp(a, b, sizeof(efi_guid_t));
-}
-
struct efi_device_path *device_path_from_handle(efi_handle_t Handle);
char *device_path_to_str(struct efi_device_path *dev_path);
u8 device_path_to_type(struct efi_device_path *dev_path);
--
2.20.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2019-10-16 7:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-16 7:21 [PATCH 1/5] efi: Fix typo in description string Ahmad Fatoum
2019-10-16 7:21 ` Ahmad Fatoum [this message]
2019-10-16 7:21 ` [PATCH 3/5] efi: use efi_guidcmp helper where appropriate Ahmad Fatoum
2019-10-16 7:21 ` [PATCH 4/5] x86: include: add asmlinkage 'storage class' Ahmad Fatoum
2019-10-16 7:21 ` [PATCH 5/5] efi: silence warning about un-prototyped assembly-called functions Ahmad Fatoum
2019-10-18 11:56 ` [PATCH 1/5] efi: Fix typo in description string Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191016072139.2323-2-ahmad@a3f.at \
--to=ahmad@a3f.at \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox