From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from va-1-114.ptr.blmpb.com (va-1-114.ptr.blmpb.com [209.127.230.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 350B235CB6D for ; Tue, 17 Mar 2026 03:56:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.127.230.114 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773719791; cv=none; b=fC5RVfp/rfioUGZQboqyqVyp3CqPtDjdMwcXY1VjJYtkAmGkyxyH2CHa/V4FS5fovPrH6T+7LZDlbeALTvuz/qniL8zNUlzbSNsF43xJOSV+4vh0Wpw9LVr+RXpe0n8Eo0FHGrtQ30k/qghgMLPuvW2cxe9ip1p7AmySLUZfH0U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773719791; c=relaxed/simple; bh=PKoZHOMMusqMN695FddIUZzOru0C9uuWUdx2Z9WfZsw=; h=Cc:Date:Message-Id:To:Mime-Version:References:In-Reply-To: Content-Type:From:Subject; b=E23TWbjrrc9RvarrujfGfjcU2ys0cDrYscimV2N9SvZtT78twyCAvMu9wbCJsdwgSNddwoxFbYFn31djhV80EegBfySBgQcIieqCRbUbcyEwNrLOnhEZp9k7BAVHhdXDSwq25VHD4WO4OxmArKHoSqaL26RL2pfXRyh02PizxRA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=Q2gu5axQ; arc=none smtp.client-ip=209.127.230.114 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="Q2gu5axQ" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=2212171451; d=bytedance.com; t=1773719775; h=from:subject: mime-version:from:date:message-id:subject:to:cc:reply-to:content-type: mime-version:in-reply-to:message-id; bh=iCikp4qx2/j7OSaQp6/EMw3DXIDHdmdKkozL/RWBbZ0=; b=Q2gu5axQelMaFtOnP+8DUxAs6M68E8Rt/cv4JMORk7ZLo3V7HE6OilJ8kOUm5Ze7kcY93u FbCwcr9B48AqKGA6uVEAhPwaohpn3f/G1TowvcVTPk1WqIhKnRJeuL0XyKflLBayMglu/C e3ppakhrAQjTrq59cizRdA8uoQBP+bMt1yuBDBBziNT6Z7tEmwnYPyLcmp2q3+ErPW81PT UTOjCFrKVakAUBmiXdFddt8d1SdYqQxzCifAx8MO8JZqwtwTfmPBEfvTzURzqQWLZgVsJe L0t3r7PrgME8+/fnJjCaGSXXhh+9OTIlne+wiMh6ZYFr8WkaWt218hxT5n54Fw== Cc: , , , , , , , , , , , , , , , , Date: Tue, 17 Mar 2026 11:55:52 +0800 Message-Id: <6ccfd504-adfd-473b-9317-0fc536acc939@bytedance.com> User-Agent: Mozilla Thunderbird X-Lms-Return-Path: To: "Breno Leitao" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260316082842.84356-1-qirui.001@bytedance.com> X-Original-From: Rui Qi In-Reply-To: Content-Type: text/plain; charset=UTF-8 From: "Rui Qi" Subject: Re: [PATCH] ACPI: APEI: ghes: mark ghes_in_nmi_spool_from_list maybe unused Content-Transfer-Encoding: quoted-printable 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=3Dunused-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. >=20 > 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: =E2=80=A2 ghes_notify_sea() under #ifdef CONFIG_ACPI_APEI_SEA =E2=80=A2 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).