From nobody Sat Feb 7 09:01:53 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 294351E0DE1 for ; Tue, 29 Oct 2024 09:23:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730193815; cv=none; b=OuSib9mq/wosIqOUfGEqvn2n4noLvqpsma5lalOme+qHFZ1qHhQ4svCBHFeh8WMcwVxJuBMNDmyqWrUYOxAmYxiXoricPMrTWW828/W58001d3Ka3H1ZyD2y+qMBeB1oK0MJijLaAxXLrjJo0VMWv8PzPK2q0wVIJ9JMHgvg6wM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730193815; c=relaxed/simple; bh=0pDD/qKzHXHs+No9iGp2bHGSwuvI7K6vrHmd7+BRnZA=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Srn4Iz4HuNIauWGKfnPkzGoC+g/XTFeOmkoatWcRV4QR9Ya7yDUyHBuDMhd8X9x+vkXypqo27XLOdgxLIfL4blJbAkKn0KqxjNxwi03K0Gn8s8KdkRn7YUmuVfyJ208k9g4/hF0OPsOaGxINUihZBLJa/20NqPg89JfmWYsPQjY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Wmfor0SW; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Wmfor0SW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB0CAC4CECD; Tue, 29 Oct 2024 09:23:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730193814; bh=0pDD/qKzHXHs+No9iGp2bHGSwuvI7K6vrHmd7+BRnZA=; h=From:To:Cc:Subject:Date:From; b=Wmfor0SWM9YB25lRSj9Vr9Azb8CUkxKzn4vlIf+alTGJKl1Mx/nqVaHAV6hwow05r SpiGKPT+oFJyPmQiFlTIP+N/7Ur6vpA3D9nUz1iII5cmYnyNcjF3Uv1XHAiyrJRfdq Qb7hDrLP02B3o8/pzKwvZXY07UgyI79C488lf6huDkfmJRWu/4F+poL8oVseStNOeT 6AAKP/yzCrqKR0qKyrsR4vrjDEQihCfltiVBTPM3F2JE2amMLIcn/H4L28smRb2KvQ wlCDGuJBc6o6xHquc/oN4ZAXJwLjAjZsxr03f/jSC+AtWSYyIKVjhHRWjvL1FUp0FJ 2Vq5ll05iW07Q== From: Arnd Bergmann To: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Cc: Arnd Bergmann , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Mario Limonciello , Bjorn Helgaas , Yazen Ghannam , Suma Hegde , Naveen Krishna Chatradhi , linux-kernel@vger.kernel.org Subject: [PATCH] platform/x86/amd/hsmp: fix compile-testing without CONFiG_AMD_NB Date: Tue, 29 Oct 2024 09:23:20 +0000 Message-Id: <20241029092329.3857004-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.5 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Arnd Bergmann node_to_amd_nb() is defined to NULL in non-AMD configs: drivers/platform/x86/amd/hsmp/plat.c: In function 'init_platform_device': drivers/platform/x86/amd/hsmp/plat.c:165:68: error: dereferencing 'void *' = pointer [-Werror] 165 | sock->root =3D node_to_amd_nb(= i)->root; | = ^~ drivers/platform/x86/amd/hsmp/plat.c:165:68: error: request for member 'roo= t' in something not a structure or union Change the definition to something that builds. This does introduce a NULL pointer dereference but the code is never called since the driver won't probe successfully. Fixes: 7d3135d16356 ("platform/x86/amd/hsmp: Create separate ACPI, plat and= common drivers") Signed-off-by: Arnd Bergmann Reviewed-by: Ilpo J=C3=A4rvinen --- arch/x86/include/asm/amd_nb.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/x86/include/asm/amd_nb.h b/arch/x86/include/asm/amd_nb.h index 6f3b6aef47ba..d0caac26533f 100644 --- a/arch/x86/include/asm/amd_nb.h +++ b/arch/x86/include/asm/amd_nb.h @@ -116,7 +116,10 @@ static inline bool amd_gart_present(void) =20 #define amd_nb_num(x) 0 #define amd_nb_has_feature(x) false -#define node_to_amd_nb(x) NULL +static inline struct amd_northbridge *node_to_amd_nb(int node) +{ + return NULL; +} #define amd_gart_present(x) false =20 #endif --=20 2.39.5