mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <ahmad@a3f.at>
To: barebox@lists.infradead.org
Subject: [PATCH 3/5] efi: use efi_guidcmp helper where appropriate
Date: Wed, 16 Oct 2019 09:21:37 +0200	[thread overview]
Message-ID: <20191016072139.2323-3-ahmad@a3f.at> (raw)
In-Reply-To: <20191016072139.2323-1-ahmad@a3f.at>

We have a helper for it. Let's use it.

Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
 drivers/efi/efi-device.c | 2 +-
 fs/efivarfs.c            | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/efi/efi-device.c b/drivers/efi/efi-device.c
index 305d337aabf5..68d81caf010b 100644
--- a/drivers/efi/efi-device.c
+++ b/drivers/efi/efi-device.c
@@ -311,7 +311,7 @@ static int efi_bus_match(struct device_d *dev, struct driver_d *drv)
 	int i;
 
 	for (i = 0; i < efidev->num_guids; i++) {
-		if (!memcmp(&efidrv->guid, &efidev->guids[i], sizeof(efi_guid_t))) {
+		if (!efi_guidcmp(efidrv->guid, efidev->guids[i])) {
 			BS->handle_protocol(efidev->handle, &efidev->guids[i],
 					&efidev->protocol);
 			return 0;
diff --git a/fs/efivarfs.c b/fs/efivarfs.c
index 1e8049362168..9eadda41215c 100644
--- a/fs/efivarfs.c
+++ b/fs/efivarfs.c
@@ -145,7 +145,7 @@ static int efivars_create(struct device_d *dev, const char *pathname, mode_t mod
 	if (ret)
 		return -ENOENT;
 
-	if (memcmp(&vendor, &EFI_BAREBOX_VENDOR_GUID, sizeof(efi_guid_t)))
+	if (efi_guidcmp(vendor, EFI_BAREBOX_VENDOR_GUID))
 		return -EPERM;
 
 	inode = xzalloc(sizeof(*inode));
-- 
2.20.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  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 ` [PATCH 2/5] efi: retire efi_compare_guid in favor of efi_guidcmp Ahmad Fatoum
2019-10-16  7:21 ` Ahmad Fatoum [this message]
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-3-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