smbios: Fix warning when building with clang
authorTom Rini <trini@konsulko.com>
Thu, 6 Nov 2025 23:28:38 +0000 (17:28 -0600)
committerTom Rini <trini@konsulko.com>
Tue, 18 Nov 2025 21:53:39 +0000 (15:53 -0600)
commit2d226a735e0e9df2c017259c72cfd569986db480
tree7981a2d229e554e7b3ed63e183874677a1d5e1f9
parenta70b4f5cae7ebe0e7d9926645635f90994f6257f
smbios: Fix warning when building with clang

When building with clang, we see warnings such as:
error: field max_size within 'struct smbios_type7' is less aligned than
'union cache_size_word' and is usually due to 'struct smbios_type7'
being packed, which can lead to unaligned accesses
[-Werror,-Wunaligned-access]
when building drivers/sysinfo/smbios.c. Resolve this error by packing
the unions as well after verifying they are complete (16 or 32 bits).

Reviewed-by: Raymond Mao <raymondmaoca@gmail.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
include/smbios.h