summaryrefslogtreecommitdiffstats
path: root/arch/mips/mm
diff options
context:
space:
mode:
authorPaul Burton2019-05-28 19:05:04 +0200
committerPaul Burton2019-05-29 21:04:44 +0200
commit31875a5432248e7b0fff2f4f4e8cd96e5d82ceb0 (patch)
tree12e49b7e7f211cfa606c7590177bbfcf3447c56f /arch/mips/mm
parentMIPS: Bounds check virt_addr_valid (diff)
downloadkernel-qcow2-linux-31875a5432248e7b0fff2f4f4e8cd96e5d82ceb0.tar.gz
kernel-qcow2-linux-31875a5432248e7b0fff2f4f4e8cd96e5d82ceb0.tar.xz
kernel-qcow2-linux-31875a5432248e7b0fff2f4f4e8cd96e5d82ceb0.zip
MIPS: Make virt_addr_valid() return bool
virt_addr_valid() really returns a boolean value, but currently uses an integer to represent it. Switch to the bool type to make it clearer that we really are returning a true or false value. Signed-off-by: Paul Burton <paul.burton@mips.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Cc: linux-mips@vger.kernel.org
Diffstat (limited to 'arch/mips/mm')
-rw-r--r--arch/mips/mm/mmap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/mips/mm/mmap.c b/arch/mips/mm/mmap.c
index 7755a1fad05a..50ee7213b432 100644
--- a/arch/mips/mm/mmap.c
+++ b/arch/mips/mm/mmap.c
@@ -201,12 +201,12 @@ unsigned long arch_randomize_brk(struct mm_struct *mm)
return ret;
}
-int __virt_addr_valid(const volatile void *kaddr)
+bool __virt_addr_valid(const volatile void *kaddr)
{
unsigned long vaddr = (unsigned long)vaddr;
if ((vaddr < PAGE_OFFSET) || (vaddr >= MAP_BASE))
- return 0;
+ return false;
return pfn_valid(PFN_DOWN(virt_to_phys(kaddr)));
}