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

- From: Michael Ellerman \<mpe@ellerman.id.au\>
- Date: 2016-07-29 11:42:12 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2016/07/9491680
- Thread: https://ratatoskr.run/linuxppc-dev/2016/07/9491623/t.md

```text
Nicholas Piggin [ref] writes:

> On Thu, 28 Jul 2016 00:18:06 +1000
> Michael Ellerman [ref] wrote:
>> 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.

cheers
```
