From: "Rui Qi" <qirui.001@bytedance.com>
To: "Breno Leitao" <leitao@debian.org>
Cc: <rafael@kernel.org>, <tony.luck@intel.com>, <bp@alien8.de>,
<guohanjun@huawei.com>, <mchehab@kernel.org>,
<xueshuai@linux.alibaba.com>, <lenb@kernel.org>,
<pjw@kernel.org>, <palmer@dabbelt.com>, <aou@eecs.berkeley.edu>,
<alex@ghiti.fr>, <jonathan.cameron@huawei.com>,
<fabio.m.de.francesco@linux.intel.com>,
<jason@os.amperecomputing.com>, <inux-acpi@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <inux-riscv@lists.infradead.org>
Subject: Re: [PATCH] ACPI: APEI: ghes: mark ghes_in_nmi_spool_from_list maybe unused
Date: Tue, 17 Mar 2026 11:55:52 +0800 [thread overview]
Message-ID: <6ccfd504-adfd-473b-9317-0fc536acc939@bytedance.com> (raw)
In-Reply-To: <abfHSqmplRlnSqFJ@gmail.com>
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).
next prev parent reply other threads:[~2026-03-17 3:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-16 8:28 Rui Qi
2026-03-16 9:03 ` Breno Leitao
2026-03-17 3:55 ` Rui Qi [this message]
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
2026-04-07 1:31 ` Shuai Xue
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6ccfd504-adfd-473b-9317-0fc536acc939@bytedance.com \
--to=qirui.001@bytedance.com \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=bp@alien8.de \
--cc=fabio.m.de.francesco@linux.intel.com \
--cc=guohanjun@huawei.com \
--cc=inux-acpi@vger.kernel.org \
--cc=inux-riscv@lists.infradead.org \
--cc=jason@os.amperecomputing.com \
--cc=jonathan.cameron@huawei.com \
--cc=leitao@debian.org \
--cc=lenb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=rafael@kernel.org \
--cc=tony.luck@intel.com \
--cc=xueshuai@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®