diff mbox series

[U-Boot,v2,03/21] efi: add some missing __packed

Message ID 20170910112149.21358-6-robdclark@gmail.com
State Deferred
Delegated to: Tom Rini
Headers show
Series None | expand

Commit Message

Rob Clark Sept. 10, 2017, 11:21 a.m. UTC
All of the device-path related structures should be packed.  UEFI
defines the device-path as a byte-aligned data structure.

Signed-off-by: Rob Clark <robdclark@gmail.com>
---
 include/efi_api.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Simon Glass Sept. 12, 2017, 12:30 p.m. UTC | #1
On 10 September 2017 at 05:21, Rob Clark <robdclark@gmail.com> wrote:
> All of the device-path related structures should be packed.  UEFI
> defines the device-path as a byte-aligned data structure.
>
> Signed-off-by: Rob Clark <robdclark@gmail.com>
> ---
>  include/efi_api.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

diff --git a/include/efi_api.h b/include/efi_api.h
index ec1b321e8e..175341348e 100644
--- a/include/efi_api.h
+++ b/include/efi_api.h
@@ -284,11 +284,11 @@  struct efi_device_path {
 	u8 type;
 	u8 sub_type;
 	u16 length;
-};
+} __packed;
 
 struct efi_mac_addr {
 	u8 addr[32];
-};
+} __packed;
 
 #define DEVICE_PATH_TYPE_MESSAGING_DEVICE	0x03
 #  define DEVICE_PATH_SUB_TYPE_MSG_MAC_ADDR	0x0b
@@ -297,7 +297,7 @@  struct efi_device_path_mac_addr {
 	struct efi_device_path dp;
 	struct efi_mac_addr mac;
 	u8 if_type;
-};
+} __packed;
 
 #define DEVICE_PATH_TYPE_MEDIA_DEVICE		0x04
 #  define DEVICE_PATH_SUB_TYPE_FILE_PATH	0x04
@@ -305,7 +305,7 @@  struct efi_device_path_mac_addr {
 struct efi_device_path_file_path {
 	struct efi_device_path dp;
 	u16 str[32];
-};
+} __packed;
 
 #define BLOCK_IO_GUID \
 	EFI_GUID(0x964e5b21, 0x6459, 0x11d2, \