Hi all, On Thu, 4 Jun 2020 16:52:46 +1000 Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx> wrote: > > diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h > index 25c3cb8272c0..a6799723cd98 100644 > --- a/arch/powerpc/include/asm/book3s/64/pgtable.h > +++ b/arch/powerpc/include/asm/book3s/64/pgtable.h > @@ -1008,6 +1008,12 @@ extern struct page *p4d_page(p4d_t p4d); > #define pud_page_vaddr(pud) __va(pud_val(pud) & ~PUD_MASKED_BITS) > #define p4d_page_vaddr(p4d) __va(p4d_val(p4d) & ~P4D_MASKED_BITS) > > +static inline unsigned long pgd_index(unsigned long address) > +{ > + return (address >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1); > +} > +#define pgd_index pgd_index > + > #define pte_ERROR(e) \ > pr_err("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e)) > #define pmd_ERROR(e) \ I have added that hunk to linux-next for tomorrow as a fix for mm-consolidate-pgd_index-and-pgd_offset_k-definitions. Its not strickly necessary, but Michael expressed a preference for the inline function. I was wondering if pgd_index "Must be a compile-time constant" on one (or a few) architectures, then why not leave the default as an inline function and special case it as a macro where needed ... -- Cheers, Stephen Rothwell
Attachment:
pgpBCjySxSC0T.pgp
Description: OpenPGP digital signature