Skip to contentSkip to conversation

acpi: Only include asm header when available

PATCH New Harm Berntsen 3 participants 5 messages Oct 30, 2020 – Jan 19, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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
index abbca6530d..8d9d0f8d19 100644
@@ -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__ */

#1 lore raw

PATCH 2/3 acpi: Only include asm header when available

Quoted 21 lines · Harm Berntsen

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
index abbca6530d..8d9d0f8d19 100644

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__ */
 
#2 lore raw

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
#3 lore raw

PATCH v2 2/3 acpi: Add missing ARM acpi_table header

Quoted 15 lines · Harm Berntsen

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.

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
#4 lore raw

PATCH v2 2/3 acpi: Add missing ARM acpi_table header

In reply to Harm Berntsen
Quoted 8 lines · Harm Berntsen

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.

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>