* [PATCH] ACPI: APEI: ghes: mark ghes_in_nmi_spool_from_list maybe unused
@ 2026-03-16 8:28 Rui Qi
2026-03-16 9:03 ` Breno Leitao
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Rui Qi @ 2026-03-16 8:28 UTC (permalink / raw)
To: rafael, tony.luck, bp, guohanjun, mchehab, xueshuai, lenb, pjw,
palmer, aou, alex, jonathan.cameron, fabio.m.de.francesco, leitao,
jason
Cc: inux-acpi, linux-kernel, inux-riscv, Rui Qi
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@bytedance.com>
---
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;
--
2.20.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH] ACPI: APEI: ghes: mark ghes_in_nmi_spool_from_list maybe unused
2026-03-16 8:28 [PATCH] ACPI: APEI: ghes: mark ghes_in_nmi_spool_from_list maybe unused Rui Qi
@ 2026-03-16 9:03 ` Breno Leitao
2026-03-17 3:55 ` Rui Qi
2026-03-17 9:39 ` Breno Leitao
2026-03-23 8:15 ` Hanjun Guo
2 siblings, 1 reply; 7+ messages in thread
From: Breno Leitao @ 2026-03-16 9:03 UTC (permalink / raw)
To: Rui Qi
Cc: rafael, tony.luck, bp, guohanjun, mchehab, xueshuai, lenb, pjw,
palmer, aou, alex, jonathan.cameron, fabio.m.de.francesco, jason,
inux-acpi, linux-kernel, inux-riscv
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()?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] ACPI: APEI: ghes: mark ghes_in_nmi_spool_from_list maybe unused
2026-03-16 9:03 ` Breno Leitao
@ 2026-03-17 3:55 ` Rui Qi
2026-03-17 9:39 ` Breno Leitao
0 siblings, 1 reply; 7+ messages in thread
From: Rui Qi @ 2026-03-17 3:55 UTC (permalink / raw)
To: Breno Leitao
Cc: rafael, tony.luck, bp, guohanjun, mchehab, xueshuai, lenb, pjw,
palmer, aou, alex, jonathan.cameron, fabio.m.de.francesco, jason,
inux-acpi, linux-kernel, inux-riscv
On 3/16/26 5:03 PM, Breno Leitao wrote:
> 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()?
Thanks for the suggestion.
ghes_in_nmi_spool_from_list() is currently used by both the SEA and
NMI paths:
• ghes_notify_sea() under #ifdef CONFIG_ACPI_APEI_SEA
• ghes_notify_nmi() under #ifdef CONFIG_HAVE_ACPI_APEI_NMI
These two Kconfig options can be enabled independently. If we moved
ghes_in_nmi_spool_from_list() into
the #ifdef CONFIG_ACPI_APEI_SEA block, a configuration that enables
CONFIG_HAVE_ACPI_APEI_NMI but not
CONFIG_ACPI_APEI_SEA would end up missing this symbol for the NMI
path.
The __maybe_unused annotation in this patch is intended to be
consistent with the nearby helpers (such
as ghes_has_active_errors(), ghes_map_error_status() and
ghes_unmap_error_status()): when both SEA and
APEI NMI support are disabled, they may be unused, and this avoids
compiler warnings about unused
static functions.
If there is consensus that we should address this via conditional
compilation instead, I can follow up
with another patch that wraps these helpers in something like #if
IS_ENABLED(CONFIG_ACPI_APEI_SEA) ||
IS_ENABLED(CONFIG_HAVE_ACPI_APEI_NMI).
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] ACPI: APEI: ghes: mark ghes_in_nmi_spool_from_list maybe unused
2026-03-17 3:55 ` Rui Qi
@ 2026-03-17 9:39 ` Breno Leitao
2026-03-23 8:14 ` Hanjun Guo
0 siblings, 1 reply; 7+ messages in thread
From: Breno Leitao @ 2026-03-17 9:39 UTC (permalink / raw)
To: Rui Qi
Cc: rafael, tony.luck, bp, guohanjun, mchehab, xueshuai, lenb, pjw,
palmer, aou, alex, jonathan.cameron, fabio.m.de.francesco, jason,
inux-acpi, linux-kernel, inux-riscv
On Tue, Mar 17, 2026 at 11:55:52AM +0800, Rui Qi wrote:
> On 3/16/26 5:03 PM, Breno Leitao wrote:
>
> If there is consensus that we should address this via conditional
> compilation instead, I can follow up
> with another patch that wraps these helpers in something like #if
> IS_ENABLED(CONFIG_ACPI_APEI_SEA) ||
> IS_ENABLED(CONFIG_HAVE_ACPI_APEI_NMI).
This approach would be worse, I would say. Your current approach seems
cleaner, IMO.
Thanks for explaining the reason here.
--breno
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] ACPI: APEI: ghes: mark ghes_in_nmi_spool_from_list maybe unused
2026-03-17 9:39 ` Breno Leitao
@ 2026-03-23 8:14 ` Hanjun Guo
0 siblings, 0 replies; 7+ messages in thread
From: Hanjun Guo @ 2026-03-23 8:14 UTC (permalink / raw)
To: Breno Leitao, Rui Qi
Cc: rafael, tony.luck, bp, mchehab, xueshuai, lenb, pjw, palmer, aou,
alex, jonathan.cameron, fabio.m.de.francesco, jason, inux-acpi,
linux-kernel, inux-riscv
On 2026/3/17 17:39, Breno Leitao wrote:
> On Tue, Mar 17, 2026 at 11:55:52AM +0800, Rui Qi wrote:
>> On 3/16/26 5:03 PM, Breno Leitao wrote:
>>
>> If there is consensus that we should address this via conditional
>> compilation instead, I can follow up
>> with another patch that wraps these helpers in something like #if
>> IS_ENABLED(CONFIG_ACPI_APEI_SEA) ||
>> IS_ENABLED(CONFIG_HAVE_ACPI_APEI_NMI).
>
> This approach would be worse, I would say. Your current approach seems
> cleaner, IMO.
Looks reasonable to me as well.
Thanks
Hanjun
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] ACPI: APEI: ghes: mark ghes_in_nmi_spool_from_list maybe unused
2026-03-16 8:28 [PATCH] ACPI: APEI: ghes: mark ghes_in_nmi_spool_from_list maybe unused Rui Qi
2026-03-16 9:03 ` Breno Leitao
@ 2026-03-17 9:39 ` Breno Leitao
2026-03-23 8:15 ` Hanjun Guo
2 siblings, 0 replies; 7+ messages in thread
From: Breno Leitao @ 2026-03-17 9:39 UTC (permalink / raw)
To: Rui Qi
Cc: rafael, tony.luck, bp, guohanjun, mchehab, xueshuai, lenb, pjw,
palmer, aou, alex, jonathan.cameron, fabio.m.de.francesco, jason,
inux-acpi, linux-kernel, inux-riscv
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.
>
> Signed-off-by: Rui Qi <qirui.001@bytedance.com>
Reviewed-by: Breno Leitao <leitao@debian.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] ACPI: APEI: ghes: mark ghes_in_nmi_spool_from_list maybe unused
2026-03-16 8:28 [PATCH] ACPI: APEI: ghes: mark ghes_in_nmi_spool_from_list maybe unused Rui Qi
2026-03-16 9:03 ` Breno Leitao
2026-03-17 9:39 ` Breno Leitao
@ 2026-03-23 8:15 ` Hanjun Guo
2 siblings, 0 replies; 7+ messages in thread
From: Hanjun Guo @ 2026-03-23 8:15 UTC (permalink / raw)
To: Rui Qi, rafael, tony.luck, bp, mchehab, xueshuai, lenb, pjw,
palmer, aou, alex, jonathan.cameron, fabio.m.de.francesco, leitao,
jason
Cc: inux-acpi, linux-kernel, inux-riscv
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@bytedance.com>
> ---
> 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@huawei.com>
Thanks
Hanjun
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-03-23 8:15 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-16 8:28 [PATCH] ACPI: APEI: ghes: mark ghes_in_nmi_spool_from_list maybe unused Rui Qi
2026-03-16 9:03 ` Breno Leitao
2026-03-17 3:55 ` Rui Qi
2026-03-17 9:39 ` Breno Leitao
2026-03-23 8:14 ` Hanjun Guo
2026-03-17 9:39 ` Breno Leitao
2026-03-23 8:15 ` Hanjun Guo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox