Skip to content

Commit 1e4e4bc

Browse files
kvaneeshmpe
authored andcommitted
powerpc/pkeys: Fix build error with PPC_MEM_KEYS disabled
IS_ENABLED() instead of #ifdef still requires variable declaration. In this specific case, default_uamor is declared in asm/pkeys.h which is only included if PPC_MEM_KEYS is enabled. arch/powerpc/mm/book3s64/hash_utils.c: In function ‘hash__early_init_mmu_secondary’: arch/powerpc/mm/book3s64/hash_utils.c:1119:21: error: ‘default_uamor’ undeclared (first use in this function) 1119 | mtspr(SPRN_UAMOR, default_uamor); | ^~~~~~~~~~~~~ Fixes: 6553fb7 ("powerpc/pkeys: Fix boot failures with Nemo board (A-EON AmigaOne X1000)") Signed-off-by: Aneesh Kumar K.V <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 388692e commit 1e4e4bc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

arch/powerpc/mm/book3s64/hash_utils.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1115,8 +1115,10 @@ void hash__early_init_mmu_secondary(void)
11151115
&& cpu_has_feature(CPU_FTR_HVMODE))
11161116
tlbiel_all();
11171117

1118-
if (IS_ENABLED(CONFIG_PPC_MEM_KEYS) && mmu_has_feature(MMU_FTR_PKEY))
1118+
#ifdef CONFIG_PPC_MEM_KEYS
1119+
if (mmu_has_feature(MMU_FTR_PKEY))
11191120
mtspr(SPRN_UAMOR, default_uamor);
1121+
#endif
11201122
}
11211123
#endif /* CONFIG_SMP */
11221124

0 commit comments

Comments
 (0)