]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
efi_selftest: efi_selftest_snp: Fix warning when building with clang
authorTom Rini <trini@konsulko.com>
Thu, 6 Nov 2025 23:28:39 +0000 (17:28 -0600)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 15 Nov 2025 10:45:29 +0000 (11:45 +0100)
When building with clang, we see a warning:
lib/efi_selftest/efi_selftest_snp.c:63:18: error: field dhcp_hdr within
'struct dhcp' is less aligned than 'struct dhcp_hdr' and is usually due
to 'struct dhcp' being packed, which can lead to unaligned accesses
[-Werror,-Wunaligned-access]
when building lib/efi_selftest/efi_selftest_snp.c. Resolve this error by
packing struct dhcp_hdr as well, as the only place it is used also is
packed.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
lib/efi_selftest/efi_selftest_snp.c

index b00c76c2f172e427a1afa8d486a35e22d09b5428..290ed3a28f2c27eb4f58e0b5d8ca815c59ba56c1 100644 (file)
@@ -43,7 +43,7 @@ struct dhcp_hdr {
        u8 chaddr[16];
        u8 sname[64];
        u8 file[128];
-};
+} __packed;
 
 /*
  * Message type option.