[PATCH 2/3] powerpc: mm: add p{te,md,ud}_user_accessible_page helpers

Rohan McLure rmclure at linux.ibm.com
Mon Sep 12 18:38:38 AEST 2022


>> +static inline bool pmd_user_accessible_page(pmd_t pmd)
>> +{
>> +	return pmd_is_leaf(pmd) && pmd_present(pmd)
>> +				&& pte_user(pmd_pte(pmd));
> 
> The && goes on previous line.

> By the way, there is a great tool that can help you :
> 
> $ ./arch/powerpc/tools/checkpatch.sh --strict -g HEAD~

Thank you. Yes I should be using --strict with checkpatch.

> 
>> +}
>> +
>> +#else
>> +
>> +static inline bool pmd_user_accessible_page(pmd_t pmd)
>> +{
>> +	BUG();
> 
> Can you use BUILD_BUG() instead ?

As it stands, p{m,u}d_user_accessible page is invoked by 
__page_table_check_p{m,u}d_{set,clear}. So unfortunately this
function will have to be compiled, but its body could be replaced
with a WARN() and return false on 32-bit.


More information about the Linuxppc-dev mailing list