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

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