Re: [PATCH] ACPI: APEI: ghes: mark ghes_in_nmi_spool_from_list maybe unused
From: Hanjun Guo
Date: Mon Mar 23 2026 - 04:15:41 EST
On 2026/3/16 16:28, Rui Qi wrote:
When CONFIG_ACPI_APEI_SEA and CONFIG_HAVE_ACPI_APEI_NMI are both
disabled, ghes_in_nmi_spool_from_list() becomes an unused static
function and triggers -Werror=unused-function in some configs (e.g.
riscv defconfig with APEI disabled).
Mark it as __maybe_unused to silence the warning while keeping the
code available for configurations that use SEA or APEI NMI.
Signed-off-by: Rui Qi <qirui.001@xxxxxxxxxxxxx>
---
drivers/acpi/apei/ghes.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
index 8acd2742bb27..1fe45949749f 100644
--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -1379,8 +1379,8 @@ static int ghes_in_nmi_queue_one_entry(struct ghes *ghes,
return rc;
}
-static int ghes_in_nmi_spool_from_list(struct list_head *rcu_list,
- enum fixed_addresses fixmap_idx)
+static int __maybe_unused ghes_in_nmi_spool_from_list(struct list_head *rcu_list,
+ enum fixed_addresses fixmap_idx)
{
int ret = -ENOENT;
struct ghes *ghes;
Reviewed-by: Hanjun Guo <guohanjun@xxxxxxxxxx>
Thanks
Hanjun