[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241029092329.3857004-1-arnd@kernel.org>
Date: Tue, 29 Oct 2024 09:23:20 +0000
From: Arnd Bergmann <arnd@...nel.org>
To: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Cc: Arnd Bergmann <arnd@...db.de>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>,
Mario Limonciello <mario.limonciello@....com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Yazen Ghannam <yazen.ghannam@....com>,
Suma Hegde <suma.hegde@....com>,
Naveen Krishna Chatradhi <naveenkrishna.chatradhi@....com>,
linux-kernel@...r.kernel.org
Subject: [PATCH] platform/x86/amd/hsmp: fix compile-testing without CONFiG_AMD_NB
From: Arnd Bergmann <arnd@...db.de>
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 = node_to_amd_nb(i)->root;
| ^~
drivers/platform/x86/amd/hsmp/plat.c:165:68: error: request for member 'root' 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 <arnd@...db.de>
---
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)
#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
#endif
--
2.39.5
Powered by blists - more mailing lists