From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-98.freemail.mail.aliyun.com (out30-98.freemail.mail.aliyun.com [115.124.30.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A54181C695 for ; Tue, 7 Apr 2026 01:31:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.98 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775525511; cv=none; b=qDdc/6/4gVDe5Ojg1BafYuxXQRVreP5E8yBb1WL30hZp5Qv4FIJnpg91lRbvIC967JsL9ZYIOWj4LbIAeafLUO7WePqUgeJSyOdGSh3FVz+GQq6MaOBNHEviKUhgiqmhNL4Yt8qe+x5Jqw0m28+YGuHDsKwkbr5VOMygTUd2/zk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775525511; c=relaxed/simple; bh=keKLul0ZGDyOXLEUxMqB5KBB5S/BVXI5i01vZpKoCkI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=vDSfPKm0lmln90hAy1bIvoNsSUrr6xD3mQk7lW0BSQpkxuzVFWaa22b5gw0VVb3vO1WJoJNgMApYcNhh6ut55RwWarytWPbCs5BfTb0EzgXBEttYjsxsDTrLYOpxEYfQw8cznkzdoPumg4I+tGNFGQK6h2q6Jjb5lJFON93mkM4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=PDyp5rz1; arc=none smtp.client-ip=115.124.30.98 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="PDyp5rz1" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1775525501; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=AEXwl2aewtTlrJwADdN1r/RG5AGei268glU4rNXymEk=; b=PDyp5rz1HpYeH1jWbU+cIisD5+uebT+wmMZB/tUfETbr2DOPudR/HAyNTSlHGltAaNtzCJ4m3RngnGlPweBDZB64bX8vfrmWu7GFMDhpfBiA80TMFKH/2jEDyKF6XpiXMSAsih2SUkWjNi62JZ2B0pdzrRApGskVysa9GnjRgMg= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R141e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033037009110;MF=xueshuai@linux.alibaba.com;NM=1;PH=DS;RN=18;SR=0;TI=SMTPD_---0X0Zxhu1_1775525497; Received: from 30.246.177.235(mailfrom:xueshuai@linux.alibaba.com fp:SMTPD_---0X0Zxhu1_1775525497 cluster:ay36) by smtp.aliyun-inc.com; Tue, 07 Apr 2026 09:31:38 +0800 Message-ID: Date: Tue, 7 Apr 2026 09:31:50 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] ACPI: APEI: ghes: mark ghes_in_nmi_spool_from_list maybe unused To: Rui Qi , rafael@kernel.org, tony.luck@intel.com, bp@alien8.de, guohanjun@huawei.com, mchehab@kernel.org, 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, leitao@debian.org, jason@os.amperecomputing.com Cc: inux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, inux-riscv@lists.infradead.org References: <20260316082842.84356-1-qirui.001@bytedance.com> From: Shuai Xue In-Reply-To: <20260316082842.84356-1-qirui.001@bytedance.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 3/16/26 4:28 PM, 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 > --- > 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; This approach is consistent with the existing pattern in the file, where several functions are already marked as __maybe_unused: $cat drivers/acpi/apei/ghes.c | grep __maybe_unused static bool __maybe_unused ghes_has_active_errors(struct list_head *ghes_list) static int __maybe_unused ghes_map_error_status(struct ghes *ghes) static void __maybe_unused ghes_unmap_error_status(struct ghes *ghes) LGTM. Reviewed-by: Shuai Xue Thanks. Shuai