Skip to contentSkip to conversation

mm-functions-may-simplify-the-use-of-return-values.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message May 13, 2022

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm: functions may simplify the use of return values
has been removed from the -mm tree. Its filename was
mm-functions-may-simplify-the-use-of-return-values.patch

This patch was dropped because it was merged into the mm-stable branch\nof git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Li kunyu <[email protected]>
Subject: mm: functions may simplify the use of return values

p4d_clear_huge may be optimized for void return type and function usage. vunmap_p4d_range function saves a few steps here.

Cc Dave Hansen <[email protected]>
Cc Andy Lutomirski <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc "H. Peter Anvin" <[email protected]>

---

 arch/x86/mm/pgtable.c   |    3 +--
 include/linux/pgtable.h |   12 +++---------
 mm/vmalloc.c            |    7 ++-----
 3 files changed, 6 insertions(+), 16 deletions(-)
arch/x86/mm/pgtable.c renamed from arch/x86/mm/pgtable.c~mm-functions-may-simplify-the-use-of-return-values +1 -2
@@ -686,9 +686,8 @@ int p4d_set_huge(p4d_t *p4d, phys_addr_t
  *
  * No 512GB pages yet -- always return 0
  */
-int p4d_clear_huge(p4d_t *p4d)
+void p4d_clear_huge(p4d_t *p4d)
 {
-	return 0;
 }
 #endif
 
include/linux/pgtable.h renamed from include/linux/pgtable.h~mm-functions-may-simplify-the-use-of-return-values +3 -9
@@ -1448,16 +1448,13 @@ static inline int pmd_protnone(pmd_t pmd
 
 #ifndef __PAGETABLE_P4D_FOLDED
 int p4d_set_huge(p4d_t *p4d, phys_addr_t addr, pgprot_t prot);
-int p4d_clear_huge(p4d_t *p4d);
+void p4d_clear_huge(p4d_t *p4d);
 #else
 static inline int p4d_set_huge(p4d_t *p4d, phys_addr_t addr, pgprot_t prot)
 {
 	return 0;
 }
-static inline int p4d_clear_huge(p4d_t *p4d)
-{
-	return 0;
-}
+static inline void p4d_clear_huge(p4d_t *p4d) { }
 #endif /* !__PAGETABLE_P4D_FOLDED */
 
 int pud_set_huge(pud_t *pud, phys_addr_t addr, pgprot_t prot);
@@ -1480,10 +1477,7 @@ static inline int pmd_set_huge(pmd_t *pm
 {
 	return 0;
 }
-static inline int p4d_clear_huge(p4d_t *p4d)
-{
-	return 0;
-}
+static inline void p4d_clear_huge(p4d_t *p4d) { }
 static inline int pud_clear_huge(pud_t *pud)
 {
 	return 0;
mm/vmalloc.c renamed from mm/vmalloc.c~mm-functions-may-simplify-the-use-of-return-values +2 -5
@@ -389,18 +389,15 @@ static void vunmap_p4d_range(pgd_t *pgd,
 {
 	p4d_t *p4d;
 	unsigned long next;
-	int cleared;
 
 	p4d = p4d_offset(pgd, addr);
 	do {
 		next = p4d_addr_end(addr, end);
 
-		cleared = p4d_clear_huge(p4d);
-		if (cleared || p4d_bad(*p4d))
+		p4d_clear_huge(p4d);
+		if (p4d_bad(*p4d))
 			*mask |= PGTBL_P4D_MODIFIED;
 
-		if (cleared)
-			continue;
 		if (p4d_none_or_clear_bad(p4d))
 			continue;
 		vunmap_pud_range(p4d, addr, next, mask);

_

Patches currently in -mm which might be from [email protected] are