git: 232bd8e8d896 - stable/13 - vm_phys: Change the return type of vm_phys_unfree_page() to bool

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Mon, 19 Jun 2023 13:08:36 UTC
The branch stable/13 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=232bd8e8d8961f4c937ea67c5e83184661447c4a

commit 232bd8e8d8961f4c937ea67c5e83184661447c4a
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2023-06-05 14:40:15 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2023-06-19 12:56:42 +0000

    vm_phys: Change the return type of vm_phys_unfree_page() to bool
    
    This is in keeping with the trend of removing uses of boolean_t, and the
    sole caller was implicitly converting it to a "bool".
    
    No functional change intended.
    
    Reviewed by:    dougm, alc, imp, kib
    MFC after:      2 weeks
    Differential Revision:  https://reviews.freebsd.org/D40401
    
    (cherry picked from commit 6062d9faf23f11e0655f3a222c204725e3111fe8)
---
 sys/vm/vm_page.c |  8 ++++----
 sys/vm/vm_phys.c | 14 +++++++-------
 sys/vm/vm_phys.h |  2 +-
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index ecabd6c4798e..6e3913517bb5 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -327,7 +327,7 @@ vm_page_blacklist_add(vm_paddr_t pa, bool verbose)
 {
 	struct vm_domain *vmd;
 	vm_page_t m;
-	int ret;
+	bool found;
 
 	m = vm_phys_paddr_to_vm_page(pa);
 	if (m == NULL)
@@ -335,15 +335,15 @@ vm_page_blacklist_add(vm_paddr_t pa, bool verbose)
 
 	vmd = vm_pagequeue_domain(m);
 	vm_domain_free_lock(vmd);
-	ret = vm_phys_unfree_page(m);
+	found = vm_phys_unfree_page(m);
 	vm_domain_free_unlock(vmd);
-	if (ret != 0) {
+	if (found) {
 		vm_domain_freecnt_inc(vmd, -1);
 		TAILQ_INSERT_TAIL(&blacklist_head, m, listq);
 		if (verbose)
 			printf("Skipping page with pa 0x%jx\n", (uintmax_t)pa);
 	}
-	return (ret);
+	return (found);
 }
 
 /*
diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c
index 6798c55cc91c..2b5a792fce6d 100644
--- a/sys/vm/vm_phys.c
+++ b/sys/vm/vm_phys.c
@@ -1288,12 +1288,12 @@ vm_phys_scan_contig(int domain, u_long npages, vm_paddr_t low, vm_paddr_t high,
 
 /*
  * Search for the given physical page "m" in the free lists.  If the search
- * succeeds, remove "m" from the free lists and return TRUE.  Otherwise, return
- * FALSE, indicating that "m" is not in the free lists.
+ * succeeds, remove "m" from the free lists and return true.  Otherwise, return
+ * false, indicating that "m" is not in the free lists.
  *
  * The free page queues must be locked.
  */
-boolean_t
+bool
 vm_phys_unfree_page(vm_page_t m)
 {
 	struct vm_freelist *fl;
@@ -1316,12 +1316,12 @@ vm_phys_unfree_page(vm_page_t m)
 		if (pa >= seg->start)
 			m_set = &seg->first_page[atop(pa - seg->start)];
 		else
-			return (FALSE);
+			return (false);
 	}
 	if (m_set->order < order)
-		return (FALSE);
+		return (false);
 	if (m_set->order == VM_NFREEORDER)
-		return (FALSE);
+		return (false);
 	KASSERT(m_set->order < VM_NFREEORDER,
 	    ("vm_phys_unfree_page: page %p has unexpected order %d",
 	    m_set, m_set->order));
@@ -1347,7 +1347,7 @@ vm_phys_unfree_page(vm_page_t m)
 		vm_freelist_add(fl, m_tmp, order, 0);
 	}
 	KASSERT(m_set == m, ("vm_phys_unfree_page: fatal inconsistency"));
-	return (TRUE);
+	return (true);
 }
 
 /*
diff --git a/sys/vm/vm_phys.h b/sys/vm/vm_phys.h
index 86785fd7579d..76c933d97914 100644
--- a/sys/vm/vm_phys.h
+++ b/sys/vm/vm_phys.h
@@ -79,7 +79,7 @@ void vm_phys_register_domains(int ndomains, struct mem_affinity *affinity,
     int *locality);
 vm_page_t vm_phys_scan_contig(int domain, u_long npages, vm_paddr_t low,
     vm_paddr_t high, u_long alignment, vm_paddr_t boundary, int options);
-boolean_t vm_phys_unfree_page(vm_page_t m);
+bool vm_phys_unfree_page(vm_page_t m);
 int vm_phys_mem_affinity(int f, int t);
 void vm_phys_early_add_seg(vm_paddr_t start, vm_paddr_t end);
 vm_paddr_t vm_phys_early_alloc(int domain, size_t alloc_size);