Skip to content

Commit fce9642

Browse files
arndbbp3tk0v
authored andcommitted
x86/amd_nb: Fix compile-testing without CONFIG_AMD_NB
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 Users of the interface who also allow COMPILE_TEST will cause the above build error so provide an inline stub to fix that. [ bp: Massage commit message. ] Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20241029092329.3857004-1-arnd@kernel.org
1 parent 8198375 commit fce9642

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

arch/x86/include/asm/amd_nb.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,10 @@ static inline bool amd_gart_present(void)
116116

117117
#define amd_nb_num(x) 0
118118
#define amd_nb_has_feature(x) false
119-
#define node_to_amd_nb(x) NULL
119+
static inline struct amd_northbridge *node_to_amd_nb(int node)
120+
{
121+
return NULL;
122+
}
120123
#define amd_gart_present(x) false
121124

122125
#endif

0 commit comments

Comments
 (0)