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