Re: [PATCH v3 10/21] powerpc/mm: Define radix_enabled() in one place & use static inline

From
Balbir Singh <bsingharora@gmail.com>
Date
2016-07-29 12:54:36
Reply to
Michael Ellerman, 2016-07-29
On Fri, 2016-07-29 at 21:42 +1000, Michael Ellerman wrote:
Nicholas Piggin [off-list ref] writes:
quoted
On Thu, 28 Jul 2016 00:18:06 +1000
Michael Ellerman [off-list ref] wrote:
quoted
diff --git a/arch/powerpc/include/asm/mmu.h
b/arch/powerpc/include/asm/mmu.h index eb942a446969..f413b3213a3b
100644 --- a/arch/powerpc/include/asm/mmu.h
+++ b/arch/powerpc/include/asm/mmu.h
@@ -163,6 +163,18 @@ static inline void assert_pte_locked(struct
mm_struct *mm, unsigned long addr) }
 #endif /* !CONFIG_DEBUG_VM */
 
+#ifdef CONFIG_PPC_RADIX_MMU
+static inline bool radix_enabled(void)
+{
+	return mmu_has_feature(MMU_FTR_TYPE_RADIX);
+}
+#else
+static inline bool radix_enabled(void)
+{
+	return false;
+}
+#endif
Won't MMU_FTRS_POSSIBLE just do the right thing when
!CONFIG_PPC_RADIX_MMU?
Yes it should.

I'll have to work out why Aneesh thought he needed to do it explicitly
and whether that is needed or not.
IIRC, If CONFIG_PPC_RADIX_MMU=n MMU_FTR_RAIDX will not be present in the
MMU_FTRS_POSSIBLE mask 

I'll also double check

Balbir
Thread (40 messages) 40 messages, 5 authors, last reply 2016-08-08
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help