Re: [PATCH for-4.8 V2 01/10] powerpc/mm: Add __cpu/__mmu_has_feature

From
Nicholas Piggin <npiggin@gmail.com>
Date
2016-07-25 05:26:13
Reply to
Aneesh Kumar K.V, 2016-07-23
On Sat, 23 Jul 2016 14:42:34 +0530
"Aneesh Kumar K.V" [off-list ref] wrote:
quoted hunk ↗ jump to hunk
In later patches, we will be switching cpu and mmu feature check to
use static keys. This would require us to have a variant of feature
check that can be used in early boot before jump label is initialized.
This patch adds the same. We also add a variant for radix_enabled()
check

We also update the return type to bool.

Signed-off-by: Aneesh Kumar K.V <redacted>
---
 arch/powerpc/include/asm/book3s/64/mmu.h | 19 +++++++++++++++----
 arch/powerpc/include/asm/cputable.h      | 15 ++++++++++-----
 arch/powerpc/include/asm/mmu.h           | 13 +++++++++++--
 arch/powerpc/xmon/ppc-dis.c              |  1 +
 4 files changed, 37 insertions(+), 11 deletions(-)
diff --git a/arch/powerpc/include/asm/book3s/64/mmu.h
b/arch/powerpc/include/asm/book3s/64/mmu.h index
6d8306d9aa7a..1bb0e536c76b 100644 ---
a/arch/powerpc/include/asm/book3s/64/mmu.h +++
b/arch/powerpc/include/asm/book3s/64/mmu.h @@ -24,9 +24,20 @@ struct
mmu_psize_def { extern struct mmu_psize_def
mmu_psize_defs[MMU_PAGE_COUNT]; 
 #ifdef CONFIG_PPC_RADIX_MMU
-#define radix_enabled() mmu_has_feature(MMU_FTR_TYPE_RADIX)
+static inline bool radix_enabled(void)
+{
+	return mmu_has_feature(MMU_FTR_TYPE_RADIX);
+}
+#define radix_enabled radix_enabled
+
+static inline bool __radix_enabled(void)
+{
+	return __mmu_has_feature(MMU_FTR_TYPE_RADIX);
+}
I'm probably guilty of this too, but the prefix-more-underscores naming
convention for a "special" variant of a function sucks, especially for
names used beyond a single file.

Might _early or similar be an improvement?

Thanks,
Nick
Thread (21 messages) 21 messages, 4 authors, last reply 2016-07-25
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