Re: [PATCH] ACPI: APEI: ghes: mark ghes_in_nmi_spool_from_list maybe unused
From: Breno Leitao
Date: Mon Mar 16 2026 - 05:06:23 EST
On Mon, Mar 16, 2026 at 04:28:42PM +0800, 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.
Isn't it better to move it to the "#ifdef CONFIG_ACPI_APEI_SEA" below?
Similarly to ghes_sea_add() and ghes_sea_remove()?