acpi: Only include asm header when available
Subsystems (2)
PATCH 2/3 acpi: Only include asm header when available
The only platforms with an asm/acpi_table.h file are X86 and Sandbox. Some drivers, i.e. pci_mmc.c, can generate ACPI info and therefore include asm/acpi_table.h by proxy. This commit ensures that the platforms wishing to use such driver and do not have ACPI support do not fail on this include. The if defined structure is also used in other places to conditionally include asm headers, i.e. arch/arm/include/asm/gpio.h
---
?include/acpi/acpi_table.h | 2 ++
?1 file changed, 2 insertions(+)
include/acpi/acpi_table.h +0 -0
@@ -690,6 +690,8 @@ void acpi_setup_base_tables(struct acpi_ctx *ctx, void *start);
?
?#endif /* !__ACPI__*/
?
+#if defined(CONFIG_X86) || defined(CONFIG_SANDBOX) ?#include <asm/acpi_table.h>
+#endif
?
?#endif /* __ACPI_TABLE_H__ */
PATCH 2/3 acpi: Only include asm header when available
Quoted 21 lines · Harm Berntsen
The only platforms with an
asm/acpi_table.hfile are X86 and Sandbox. Some drivers, i.e.pci_mmc.c, can generate ACPI info and therefore includeasm/acpi_table.hby proxy. This commit ensures that the platforms wishing to use such driver and do not have ACPI support do not fail on this include. The if defined structure is also used in other places to conditionally include asm headers, i.e.arch/arm/include/asm/gpio.hSigned-off-by Harm Berntsen <[email protected]>CC Simon Glass <[email protected]>---
include/acpi/acpi_table.h | 2 ++ 1 file changed, 2 insertions(+)include/acpi/acpi_table.h +0
-0
include/acpi/acpi_table.h void acpi_setup_base_tables(struct acpi_ctx *ctx, void *start); · line 695
Quoted 6 lines
include/acpi/acpi_table.h +2
-0@@ -690,6 +690,8 @@ void acpi_setup_base_tables(struct acpi_ctx *ctx, void *start);#endif /* !__ACPI__*/ +#if defined(CONFIG_X86 ) || defined(CONFIG_SANDBOX )#include <asm/acpi_table.h> +#endif
But how about adding an empty file for the other architecture?
Quoted 3 lines
include/acpi/acpi_table.h +0
-0#endif /* __ACPI_TABLE_H__ */
PATCH v2 2/3 acpi: Add missing ARM acpi_table header
The pci_mmc.c driver can generate ACPI info and therefore includes asm/acpi_table.h by proxy. This file does not exist for the ARM architecture and thus code compilation failed when using this driver on ARM.
---
Changes for v2:
Different approach, the previous commit (acpi: Only include asm header when available) used ifdefs to conditionally include acpi_table.h. Based on Simon's suggestion this patch adds an empty file to fix the issue.
arch/arm/include/asm/acpi_table.h | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 arch/arm/include/asm/acpi_table.h
(quoted diff) +0 -0
b/arch/arm/include/asm/acpi_table.h
new file mode 100644
index 0000000000..e69de29bb2
Signature · 1 line
2.29.2
PATCH v2 2/3 acpi: Add missing ARM acpi_table header
Quoted 15 lines · Harm Berntsen
The
pci_mmc.cdriver can generate ACPI info and therefore includesasm/acpi_table.hby proxy. This file does not exist for the ARM architecture and thus code compilation failed when using this driver on ARM.Signed-off-by Harm Berntsen <[email protected]>CC Simon Glass <[email protected]>---
Changes for v2:
Different approach, the previous commit (acpi: Only include asm header when available) used ifdefs to conditionally includeacpi_table.h. Based on Simon's suggestion this patch adds an empty file to fix the issue.
Quoted 3 lines
arch/arm/include/asm/acpi_table.h | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 arch/arm/include/asm/acpi_table.h
Quoted 2 lines
PATCH v2 2/3 acpi: Add missing ARM acpi_table header
In reply to Harm BerntsenQuoted 8 lines · Harm Berntsen
The
pci_mmc.cdriver can generate ACPI info and therefore includesasm/acpi_table.hby proxy. This file does not exist for the ARM architecture and thus code compilation failed when using this driver on ARM.Signed-off-by Harm Berntsen <[email protected]>CC Simon Glass <[email protected]>Reviewed-by Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210119/19049256/attachment.sig>