git: 9e0164087cbf - main - vm: Change the return types of kernacc and useracc to bool

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Fri, 10 May 2024 20:45:33 UTC
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=9e0164087cbf395624f63a5343357e2f6bd0370c

commit 9e0164087cbf395624f63a5343357e2f6bd0370c
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2024-05-10 20:43:56 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2024-05-10 20:43:56 +0000

    vm: Change the return types of kernacc and useracc to bool
    
    Reviewed by:    kib
    Differential Revision:  https://reviews.freebsd.org/D45156
---
 sys/vm/vm_extern.h | 4 ++--
 sys/vm/vm_glue.c   | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/sys/vm/vm_extern.h b/sys/vm/vm_extern.h
index b50abab7380c..8c9addda1196 100644
--- a/sys/vm/vm_extern.h
+++ b/sys/vm/vm_extern.h
@@ -83,8 +83,8 @@ void kmem_init(vm_offset_t, vm_offset_t);
 void kmem_init_zero_region(void);
 void kmeminit(void);
 
-int kernacc(void *, int, int);
-int useracc(void *, int, int);
+bool kernacc(void *, int, int);
+bool useracc(void *, int, int);
 int vm_fault(vm_map_t map, vm_offset_t vaddr, vm_prot_t fault_type,
     int fault_flags, vm_page_t *m_hold);
 void vm_fault_copy_entry(vm_map_t, vm_map_t, vm_map_entry_t, vm_map_entry_t,
diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c
index 979a0fc27120..641800413e68 100644
--- a/sys/vm/vm_glue.c
+++ b/sys/vm/vm_glue.c
@@ -122,7 +122,7 @@
  * just checking the vm_map_entry is sufficient within the kernel's address
  * space.
  */
-int
+bool
 kernacc(void *addr, int len, int rw)
 {
 	boolean_t rv;
@@ -134,7 +134,7 @@ kernacc(void *addr, int len, int rw)
 
 	if ((vm_offset_t)addr + len > vm_map_max(kernel_map) ||
 	    (vm_offset_t)addr + len < (vm_offset_t)addr)
-		return (FALSE);
+		return (false);
 
 	prot = rw;
 	saddr = trunc_page((vm_offset_t)addr);
@@ -154,7 +154,7 @@ kernacc(void *addr, int len, int rw)
  * vm_fault_quick(), or copyin()/copout()/su*()/fu*() functions should be
  * used in conjunction with this call.
  */
-int
+bool
 useracc(void *addr, int len, int rw)
 {
 	boolean_t rv;
@@ -167,7 +167,7 @@ useracc(void *addr, int len, int rw)
 	map = &curproc->p_vmspace->vm_map;
 	if ((vm_offset_t)addr + len > vm_map_max(map) ||
 	    (vm_offset_t)addr + len < (vm_offset_t)addr) {
-		return (FALSE);
+		return (false);
 	}
 	vm_map_lock_read(map);
 	rv = vm_map_check_protection(map, trunc_page((vm_offset_t)addr),