powerpc/pkeys: Fix build error with PPC_MEM_KEYS disabled
PATCH 1/1 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);
| ^~~~~~~~~~~~~--- arch/powerpc/mm/book3s64/hash_utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/powerpc/mm/book3s64/hash_utils.c +3 -1
@@ -1115,8 +1115,10 @@ void hash__early_init_mmu_secondary(void) && cpu_has_feature(CPU_FTR_HVMODE))tlbiel_all (); -if (IS_ENABLED (CONFIG_PPC_MEM_KEYS ) &&mmu_has_feature (MMU_FTR_PKEY )) +#ifdef CONFIG_PPC_MEM_KEYS +if (mmu_has_feature (MMU_FTR_PKEY ))mtspr (SPRN_UAMOR , default_uamor); +#endif }#endif /* CONFIG_SMP */
Signature · 1 line
2.26.2
Michael Ellerman
AppliedQuoted 8 lines · Aneesh Kumar K.V
IS_ENABLED()instead of #ifdef still requires variable declaration. In this specific case,default_uamoris declared inasm/pkeys.hwhich is only included ifPPC_MEM_KEYSis 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); | ^~~~~~~~~~~~~
Applied to powerpc/fixes.
[1/1] powerpc/pkeys: Fix build error with PPC_MEM_KEYS disabled
https://git.kernel.org/powerpc/c/1e4e4bcaf70ec89f8b499c93a83d078c1e5c0ea6
cheers