vm: Change the return types of kernacc and useracc to bool

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D45156
This commit is contained in:
John Baldwin 2024-05-10 13:43:56 -07:00
parent 473c90ac04
commit 9e0164087c
2 changed files with 6 additions and 6 deletions

View File

@ -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,

View File

@ -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),