All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/pkeys: Fix build error with PPC_MEM_KEYS disabled
@ 2020-08-17 10:33 Aneesh Kumar K.V
  2020-08-18 13:58 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Aneesh Kumar K.V @ 2020-08-17 10:33 UTC (permalink / raw
  To: linuxppc-dev, mpe; +Cc: Aneesh Kumar K.V

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: 6553fb799f60 ("powerpc/pkeys: Fix boot failures with Nemo board (A-EON AmigaOne X1000)")
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
---
 arch/powerpc/mm/book3s64/hash_utils.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/mm/book3s64/hash_utils.c b/arch/powerpc/mm/book3s64/hash_utils.c
index 1da9dbba9217..890a71c5293e 100644
--- a/arch/powerpc/mm/book3s64/hash_utils.c
+++ b/arch/powerpc/mm/book3s64/hash_utils.c
@@ -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 */
 
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] powerpc/pkeys: Fix build error with PPC_MEM_KEYS disabled
  2020-08-17 10:33 [PATCH] powerpc/pkeys: Fix build error with PPC_MEM_KEYS disabled Aneesh Kumar K.V
@ 2020-08-18 13:58 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2020-08-18 13:58 UTC (permalink / raw
  To: linuxppc-dev, mpe, Aneesh Kumar K.V

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 729 bytes --]

On Mon, 17 Aug 2020 16:03:01 +0530, Aneesh Kumar K.V wrote:
> 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);
>       |                     ^~~~~~~~~~~~~

Applied to powerpc/fixes.

[1/1] powerpc/pkeys: Fix build error with PPC_MEM_KEYS disabled
      https://git.kernel.org/powerpc/c/1e4e4bcaf70ec89f8b499c93a83d078c1e5c0ea6

cheers

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-18 14:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-17 10:33 [PATCH] powerpc/pkeys: Fix build error with PPC_MEM_KEYS disabled Aneesh Kumar K.V
2020-08-18 13:58 ` Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.