summaryrefslogtreecommitdiff
path: root/mm/memory.c
diff options
context:
space:
mode:
authorMiaohe Lin <linmiaohe@huawei.com>2022-03-23 00:42:30 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2022-03-23 01:57:05 +0300
commit88a359125a2b8f2437f09ab3b1af4815c89690d4 (patch)
tree218a2d20e8454ed6ebe2f9fdf5f6f532ac3d332f /mm/memory.c
parente6d094936988910ce6e8197570f2753898830081 (diff)
downloadlinux-88a359125a2b8f2437f09ab3b1af4815c89690d4.tar.xz
mm/memory.c: use helper function range_in_vma()
Use helper function range_in_vma() to check if address, address + size are within the vma range. Minor readability improvement. Link: https://lkml.kernel.org/r/20220219021441.29173-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/memory.c')
-rw-r--r--mm/memory.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 2dbb4ac35e93..3cbcf3a3e20a 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1715,7 +1715,7 @@ static void zap_page_range_single(struct vm_area_struct *vma, unsigned long addr
void zap_vma_ptes(struct vm_area_struct *vma, unsigned long address,
unsigned long size)
{
- if (address < vma->vm_start || address + size > vma->vm_end ||
+ if (!range_in_vma(vma, address, address + size) ||
!(vma->vm_flags & VM_PFNMAP))
return;