diff mbox series

[v1] LoongArch: Remove CONFIG_ACPI_TABLE_UPGRADE in platform_init()

Message ID 20240529063206.30421-1-yangtiezhu@loongson.cn
State Accepted
Commit 6c3ca6654a74dd396bc477839ba8d9792eced441
Headers show
Series [v1] LoongArch: Remove CONFIG_ACPI_TABLE_UPGRADE in platform_init() | expand

Commit Message

Tiezhu Yang May 29, 2024, 6:32 a.m. UTC
acpi_table_upgrade() and acpi_boot_table_init() are defined as
empty function under !CONFIG_ACPI_TABLE_UPGRADE and !CONFIG_ACPI
in include/linux/acpi.h, there are no implicit declaration errors
with various configs.

As Huacai suggested, CONFIG_ACPI_TABLE_UPGRADE is ugly and not
necessary here, just remove it. At the same time, just keep
CONFIG_ACPI to prevent build error and give a signal to tell
us the code is ACPI-specific, and also put acpi_table_upgrade()
under CONFIG_ACPI.

  #ifdef CONFIG_ACPI_TABLE_UPGRADE
  void acpi_table_upgrade(void);
  #else
  static inline void acpi_table_upgrade(void) { }
  #endif

  #ifdef	CONFIG_ACPI
  ...
  void acpi_boot_table_init (void);
  ...
  #else	/* !CONFIG_ACPI */
  ...
  static inline void acpi_boot_table_init(void)
  {
  }
  ...
  #endif	/* !CONFIG_ACPI */

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 arch/loongarch/kernel/setup.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/arch/loongarch/kernel/setup.c b/arch/loongarch/kernel/setup.c
index ea6d5db6c878..08a077e4efd7 100644
--- a/arch/loongarch/kernel/setup.c
+++ b/arch/loongarch/kernel/setup.c
@@ -353,10 +353,8 @@  void __init platform_init(void)
 	arch_reserve_vmcore();
 	arch_reserve_crashkernel();
 
-#ifdef CONFIG_ACPI_TABLE_UPGRADE
-	acpi_table_upgrade();
-#endif
 #ifdef CONFIG_ACPI
+	acpi_table_upgrade();
 	acpi_gbl_use_default_register_widths = false;
 	acpi_boot_table_init();
 #endif