diff mbox series

[v2,4/7] mm/x86: Drop two unnecessary pud_leaf() definitions

Message ID 20240229084258.599774-5-peterx@redhat.com (mailing list archive)
State New
Headers show
Series mm/treewide: Replace pXd_large() with pXd_leaf() | expand

Commit Message

Peter Xu Feb. 29, 2024, 8:42 a.m. UTC
From: Peter Xu <peterx@redhat.com>

pud_leaf() has a fallback macro defined in include/linux/pgtable.h already.
Drop the extra two for x86.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: x86@kernel.org
Signed-off-by: Peter Xu <peterx@redhat.com>
---
 arch/x86/include/asm/pgtable.h      | 1 -
 include/asm-generic/pgtable-nopmd.h | 1 -
 2 files changed, 2 deletions(-)

Comments

Jason Gunthorpe March 4, 2024, 1:03 p.m. UTC | #1
On Thu, Feb 29, 2024 at 04:42:55PM +0800, peterx@redhat.com wrote:
> From: Peter Xu <peterx@redhat.com>
> 
> pud_leaf() has a fallback macro defined in include/linux/pgtable.h already.
> Drop the extra two for x86.
> 
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Borislav Petkov <bp@alien8.de>
> Cc: Dave Hansen <dave.hansen@linux.intel.com>
> Cc: x86@kernel.org
> Signed-off-by: Peter Xu <peterx@redhat.com>
> ---
>  arch/x86/include/asm/pgtable.h      | 1 -
>  include/asm-generic/pgtable-nopmd.h | 1 -
>  2 files changed, 2 deletions(-)

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>

> @@ -31,7 +31,6 @@ static inline int pud_none(pud_t pud)		{ return 0; }
>  static inline int pud_bad(pud_t pud)		{ return 0; }
>  static inline int pud_present(pud_t pud)	{ return 1; }
>  static inline int pud_user(pud_t pud)		{ return 0; }
> -static inline int pud_leaf(pud_t pud)		{ return 0; }

It would be nice to have a final patch making the signatures
consistent on all the arch inlines, it should return bool not int.

Jason
Thomas Gleixner March 4, 2024, 2:18 p.m. UTC | #2
On Thu, Feb 29 2024 at 16:42, peterx@redhat.com wrote:
> From: Peter Xu <peterx@redhat.com>
>
> pud_leaf() has a fallback macro defined in include/linux/pgtable.h already.
> Drop the extra two for x86.
>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Ingo Molnar <mingo@redhat.com>
> Cc: Borislav Petkov <bp@alien8.de>
> Cc: Dave Hansen <dave.hansen@linux.intel.com>
> Cc: x86@kernel.org
> Signed-off-by: Peter Xu <peterx@redhat.com>

Acked-by: Thomas Gleixner <tglx@linutronix.de>
Peter Xu March 5, 2024, 3:25 a.m. UTC | #3
On Mon, Mar 04, 2024 at 09:03:34AM -0400, Jason Gunthorpe wrote:
> On Thu, Feb 29, 2024 at 04:42:55PM +0800, peterx@redhat.com wrote:
> > From: Peter Xu <peterx@redhat.com>
> > 
> > pud_leaf() has a fallback macro defined in include/linux/pgtable.h already.
> > Drop the extra two for x86.
> > 
> > Cc: Thomas Gleixner <tglx@linutronix.de>
> > Cc: Ingo Molnar <mingo@redhat.com>
> > Cc: Borislav Petkov <bp@alien8.de>
> > Cc: Dave Hansen <dave.hansen@linux.intel.com>
> > Cc: x86@kernel.org
> > Signed-off-by: Peter Xu <peterx@redhat.com>
> > ---
> >  arch/x86/include/asm/pgtable.h      | 1 -
> >  include/asm-generic/pgtable-nopmd.h | 1 -
> >  2 files changed, 2 deletions(-)
> 
> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
> 
> > @@ -31,7 +31,6 @@ static inline int pud_none(pud_t pud)		{ return 0; }
> >  static inline int pud_bad(pud_t pud)		{ return 0; }
> >  static inline int pud_present(pud_t pud)	{ return 1; }
> >  static inline int pud_user(pud_t pud)		{ return 0; }
> > -static inline int pud_leaf(pud_t pud)		{ return 0; }
> 
> It would be nice to have a final patch making the signatures
> consistent on all the arch inlines, it should return bool not int.

Makes sense, will do, thanks.
diff mbox series

Patch

diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 69ed0ea0641b..f884d5162507 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -1097,7 +1097,6 @@  static inline int pud_bad(pud_t pud)
 	return (pud_flags(pud) & ~(_KERNPG_TABLE | _PAGE_USER)) != 0;
 }
 #else
-#define pud_leaf	pud_large
 static inline int pud_large(pud_t pud)
 {
 	return 0;
diff --git a/include/asm-generic/pgtable-nopmd.h b/include/asm-generic/pgtable-nopmd.h
index 8ffd64e7a24c..fa27e16bbe1b 100644
--- a/include/asm-generic/pgtable-nopmd.h
+++ b/include/asm-generic/pgtable-nopmd.h
@@ -31,7 +31,6 @@  static inline int pud_none(pud_t pud)		{ return 0; }
 static inline int pud_bad(pud_t pud)		{ return 0; }
 static inline int pud_present(pud_t pud)	{ return 1; }
 static inline int pud_user(pud_t pud)		{ return 0; }
-static inline int pud_leaf(pud_t pud)		{ return 0; }
 static inline void pud_clear(pud_t *pud)	{ }
 #define pmd_ERROR(pmd)				(pud_ERROR((pmd).pud))