[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
Signed-off-by: Harm Berntsen harm.berntsen@nedap.com CC: Simon Glass sjg@chromium.org ---
include/acpi/acpi_table.h | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/include/acpi/acpi_table.h b/include/acpi/acpi_table.h index abbca6530d..8d9d0f8d19 100644 --- a/include/acpi/acpi_table.h +++ b/include/acpi/acpi_table.h @@ -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__ */

On Fri, 30 Oct 2020 at 02:45, Harm Berntsen harm.berntsen@nedap.com wrote:
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
Signed-off-by: Harm Berntsen harm.berntsen@nedap.com CC: Simon Glass sjg@chromium.org
include/acpi/acpi_table.h | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/include/acpi/acpi_table.h b/include/acpi/acpi_table.h index abbca6530d..8d9d0f8d19 100644 --- a/include/acpi/acpi_table.h +++ b/include/acpi/acpi_table.h @@ -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
Reviewed-by: Simon Glass sjg@chromium.org
But how about adding an empty file for the other architecture?
#endif /* __ACPI_TABLE_H__ */

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.
Signed-off-by: Harm Berntsen harm.berntsen@nedap.com CC: Simon Glass sjg@chromium.org --- 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
diff --git a/arch/arm/include/asm/acpi_table.h b/arch/arm/include/asm/acpi_table.h new file mode 100644 index 0000000000..e69de29bb2

On Fri, 6 Nov 2020 at 05:24, Harm Berntsen harm.berntsen@nedap.com wrote:
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.
Signed-off-by: Harm Berntsen harm.berntsen@nedap.com CC: Simon Glass sjg@chromium.org
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
Reviewed-by: Simon Glass sjg@chromium.org

On Fri, Nov 06, 2020 at 12:24:17PM +0000, Harm Berntsen wrote:
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.
Signed-off-by: Harm Berntsen harm.berntsen@nedap.com CC: Simon Glass sjg@chromium.org Reviewed-by: Simon Glass sjg@chromium.org
Applied to u-boot/master, thanks!
participants (3)
-
Harm Berntsen
-
Simon Glass
-
Tom Rini