[U-Boot] [PATCH v1 1/4] x86: acpi: Annotate struct acpi_table_header with __packed

Bin Meng bmeng.cn at gmail.com
Thu Aug 29 14:13:05 UTC 2019


Hi Andy,

On Thu, Aug 29, 2019 at 10:04 PM Andy Shevchenko
<andriy.shevchenko at linux.intel.com> wrote:
>
> GCC starts complaining about possible pointer misalignment of pointers to the

Which GCC version?

> unpacked (alignment=4) structures in the packed (alignment=1) ones:
>
>   CC      arch/x86/cpu/tangier/acpi.o
> arch/x86/cpu/tangier/acpi.c: In function ‘acpi_create_fadt’:
> arch/x86/cpu/tangier/acpi.c:22:37: warning: taking address of packed member of ‘struct acpi_fadt’ may result in an unaligned pointer value [-Waddress-of-packed-member]
>   22 |  struct acpi_table_header *header = &(fadt->header);
>
>   CC      arch/x86/lib/acpi_table.o
> arch/x86/lib/acpi_table.c: In function ‘acpi_create_spcr’:
> arch/x86/lib/acpi_table.c:366:37: warning: taking address of packed member of ‘struct acpi_spcr’ may result in an unaligned pointer value [-Waddress-of-packed-member]
>   366 |  struct acpi_table_header *header = &(spcr->header);
>
> Fix the potential issues by annotating embedded structures with __packed even
> though they are packed naturally.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko at linux.intel.com>
> ---
>  arch/x86/include/asm/acpi_table.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

Regards,
Bin


More information about the U-Boot mailing list