Re: [PATCH 41/75] hexagon: Add pmd_pfn()

From: Mike Rapoport
Date: Sun Feb 06 2022 - 13:13:40 EST


On Fri, Feb 04, 2022 at 07:58:18PM +0000, Matthew Wilcox (Oracle) wrote:
> I need to use this function in common code, so define it for hexagon.
>
> Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>
> ---
> arch/hexagon/include/asm/pgtable.h | 3 ++-

Why hexagon out of all architectures?
What about m68k, nios2, nds32 etc?

> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/hexagon/include/asm/pgtable.h b/arch/hexagon/include/asm/pgtable.h
> index 18cd6ea9ab23..87e96463ccd6 100644
> --- a/arch/hexagon/include/asm/pgtable.h
> +++ b/arch/hexagon/include/asm/pgtable.h
> @@ -235,10 +235,11 @@ static inline int pmd_bad(pmd_t pmd)
> return 0;
> }
>
> +#define pmd_pfn(pmd) (pmd_val(pmd) >> PAGE_SHIFT)

I'd put it in include/linux/pgtable.h inside #ifndef pmd_pfn

> /*
> * pmd_page - converts a PMD entry to a page pointer
> */
> -#define pmd_page(pmd) (pfn_to_page(pmd_val(pmd) >> PAGE_SHIFT))
> +#define pmd_page(pmd) (pfn_to_page(pmd_pfn(pmd)))
>
> /**
> * pte_none - check if pte is mapped
> --
> 2.34.1
>
>

--
Sincerely yours,
Mike.