[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240529063206.30421-1-yangtiezhu@loongson.cn>
Date: Wed, 29 May 2024 14:32:06 +0800
From: Tiezhu Yang <yangtiezhu@...ngson.cn>
To: Huacai Chen <chenhuacai@...nel.org>,
rafael@...nel.org
Cc: loongarch@...ts.linux.dev,
linux-acpi@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH v1] LoongArch: Remove CONFIG_ACPI_TABLE_UPGRADE in platform_init()
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@...ngson.cn>
---
arch/loongarch/kernel/setup.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
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
--
2.42.0
Powered by blists - more mailing lists