Blame SOURCES/0009-Fix-another-error-of-Werror-address-of-packed-member.patch

4e0e09
From d10381d23097d96afbb8d7c4199e58164da0d870 Mon Sep 17 00:00:00 2001
4e0e09
From: Chih-Wei Huang <cwhuang@linux.org.tw>
4e0e09
Date: Tue, 26 Feb 2019 18:42:20 +0800
4e0e09
Subject: [PATCH 09/63] Fix another error of -Werror=address-of-packed-member
4e0e09
4e0e09
Android 9 clang complains:
4e0e09
4e0e09
external/efivar/src/dp-message.c:367:24: error: taking address of packed member '' of class or structure 'efidp_infiniband' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member]
4e0e09
                                    (efi_guid_t *)&dp->infiniband.ioc_guid);
4e0e09
                                                   ^~~~~~~~~~~~~~~~~~~~~~~
4e0e09
external/efivar/src/dp.h:76:19: note: expanded from macro 'format_guid'
4e0e09
                memmove(&_guid, guid, sizeof(_guid));                   \
4e0e09
                                ^~~~
4e0e09
1 error generated.
4e0e09
4e0e09
Since commit c3c553d the fifth parameter of format_guid() is treated as
4e0e09
a const void *. The casting is unnecessary.
4e0e09
4e0e09
Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
4e0e09
---
4e0e09
 src/dp-media.c   | 3 +--
4e0e09
 src/dp-message.c | 2 +-
4e0e09
 2 files changed, 2 insertions(+), 3 deletions(-)
4e0e09
4e0e09
diff --git a/src/dp-media.c b/src/dp-media.c
4e0e09
index 96a576fdc2a..be691c44326 100644
4e0e09
--- a/src/dp-media.c
4e0e09
+++ b/src/dp-media.c
4e0e09
@@ -46,8 +46,7 @@ _format_media_dn(char *buf, size_t size, const_efidp dp)
4e0e09
 			break;
4e0e09
 		case EFIDP_HD_SIGNATURE_GUID:
4e0e09
 			format(buf, size, off, "HD", "GPT,");
4e0e09
-			format_guid(buf, size, off, "HD",
4e0e09
-				    (efi_guid_t *)dp->hd.signature);
4e0e09
+			format_guid(buf, size, off, "HD", dp->hd.signature);
4e0e09
 			format(buf, size, off, "HD",
4e0e09
 			       ",0x%"PRIx64",0x%"PRIx64")",
4e0e09
 			       dp->hd.start, dp->hd.size);
4e0e09
diff --git a/src/dp-message.c b/src/dp-message.c
4e0e09
index 9f964663de8..6b8e9072594 100644
4e0e09
--- a/src/dp-message.c
4e0e09
+++ b/src/dp-message.c
4e0e09
@@ -364,7 +364,7 @@ _format_message_dn(char *buf, size_t size, const_efidp dp)
4e0e09
 			       dp->infiniband.port_gid[1],
4e0e09
 			       dp->infiniband.port_gid[0]);
4e0e09
 			format_guid(buf, size, off, "Infiniband",
4e0e09
-				    (efi_guid_t *)&dp->infiniband.ioc_guid);
4e0e09
+				    &dp->infiniband.ioc_guid);
4e0e09
 			format(buf, size, off, "Infiniband",
4e0e09
 			       ",%"PRIu64",%"PRIu64")",
4e0e09
 			       dp->infiniband.target_port_id,
4e0e09
-- 
4e0e09
2.26.2
4e0e09