Blame SOURCES/0010-dmidecode-Share-common-EFI-code.patch

5f4333
From 97d23fb9a642574ef4415e71e4a01387d06744d6 Mon Sep 17 00:00:00 2001
5f4333
From: Jean Delvare <jdelvare@suse.de>
5f4333
Date: Thu, 30 Nov 2017 16:27:56 +0100
5f4333
Subject: [PATCH 10/10] dmidecode: Share common EFI code
5f4333
5f4333
Avoid duplicating code between OS-specific paths.
5f4333
5f4333
---
5f4333
 dmidecode.c | 15 ++++++++-------
5f4333
 1 file changed, 8 insertions(+), 7 deletions(-)
5f4333
5f4333
diff --git a/dmidecode.c b/dmidecode.c
5f4333
index aadef75..87faaa9 100644
5f4333
--- a/dmidecode.c
5f4333
+++ b/dmidecode.c
5f4333
@@ -4946,6 +4946,7 @@ static int address_from_efi(off_t *address)
5f4333
 #elif defined(__FreeBSD__)
5f4333
 	char addrstr[KENV_MVALLEN + 1];
5f4333
 #endif
5f4333
+	const char *eptype;
5f4333
 	int ret;
5f4333
 
5f4333
 	*address = 0; /* Prevent compiler warning */
5f4333
@@ -4970,9 +4971,7 @@ static int address_from_efi(off_t *address)
5f4333
 		 || strcmp(linebuf, "SMBIOS") == 0)
5f4333
 		{
5f4333
 			*address = strtoull(addrp, NULL, 0);
5f4333
-			if (!(opt.flags & FLAG_QUIET))
5f4333
-				printf("# %s entry point at 0x%08llx\n",
5f4333
-				       linebuf, (unsigned long long)*address);
5f4333
+			eptype = linebuf;
5f4333
 			ret = 0;
5f4333
 			break;
5f4333
 		}
5f4333
@@ -4997,14 +4996,16 @@ static int address_from_efi(off_t *address)
5f4333
 	}
5f4333
 
5f4333
 	*address = strtoull(addrstr, NULL, 0);
5f4333
-	if (!(opt.flags & FLAG_QUIET))
5f4333
-		printf("# SMBIOS entry point at 0x%08llx\n",
5f4333
-		    (unsigned long long)*address);
5f4333
-
5f4333
+	eptype = "SMBIOS";
5f4333
 	ret = 0;
5f4333
 #else
5f4333
 	ret = EFI_NOT_FOUND;
5f4333
 #endif
5f4333
+
5f4333
+	if (ret == 0 && !(opt.flags & FLAG_QUIET))
5f4333
+		printf("# %s entry point at 0x%08llx\n",
5f4333
+		       eptype, (unsigned long long)*address);
5f4333
+
5f4333
 	return ret;
5f4333
 }
5f4333
 
5f4333
-- 
5f4333
2.9.5
5f4333