diff options
| author | Ilias Apalodimas <[email protected]> | 2023-05-11 19:40:35 +0300 |
|---|---|---|
| committer | Heinrich Schuchardt <[email protected]> | 2023-05-13 11:09:51 +0200 |
| commit | 7dfab39855897418c05ccb6f4213c840f91d1c30 (patch) | |
| tree | 44bbe49c4fa81c5b4ea94a93140883efbef00874 /scripts/const_structs.checkpatch | |
| parent | 227d3b3e0af02918592dda19aefa379e9ea20887 (diff) | |
efi_loader: Fix warnings for unaligned accesses
Tom reports that when building with clang we see this warning:
field guid within 'struct efi_hii_keyboard_layout' is less aligned than 'efi_guid_t' and is usually due to 'struct efi_hii_keyboard_layout' being packed, which can lead to unaligned accesses [-Wunaligned-access]
This happens because 'struct efi_hii_keyboard_layout' is defined as
packed and thus has 1-byte alignment but efi_guid_t is a type that
requires greater alignment than that.
However the EFI spec describes the EFI_GUID as
"128-bit buffer containing a unique identifier value.
Unless otherwise specified"
So convert the efi_guid_t -> u8 b[16] here and skip the alignment
requirements. Since the struct is packed to begin with, it makes no
difference on the final memory layout.
Suggested-by: Heinrich Schuchardt <[email protected]>
Reported-by: Tom Rini <[email protected]>
Signed-off-by: Ilias Apalodimas <[email protected]>
Reviewed-by: Heinrich Schuchardt <[email protected]>
Diffstat (limited to 'scripts/const_structs.checkpatch')
0 files changed, 0 insertions, 0 deletions
