]> git.dujemihanovic.xyz Git - u-boot.git/commit
x86: acpi: Annotate struct acpi_table_header with __packed
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 29 Aug 2019 14:04:18 +0000 (17:04 +0300)
committerBin Meng <bmeng.cn@gmail.com>
Tue, 10 Sep 2019 08:17:55 +0000 (16:17 +0800)
commit19b6e1ba8c67e413d73df9db7e0c88c379e033a7
tree59d0104a7f9470a34b709da01c7ffbfbe41529b3
parent5793553fa24077e3b91028f8097fb1fdbede1480
x86: acpi: Annotate struct acpi_table_header with __packed

GCC 9.2 starts complaining about possible pointer misalignment of
pointers to the 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@linux.intel.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
[bmeng: add GCC version number in the commit message]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
arch/x86/include/asm/acpi_table.h