]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
mm/memory.c: use helper function range_in_vma()
authorMiaohe Lin <linmiaohe@huawei.com>
Tue, 22 Mar 2022 21:42:30 +0000 (14:42 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 22 Mar 2022 22:57:05 +0000 (15:57 -0700)
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>
mm/memory.c

index 2dbb4ac35e9395e48d58e54990730069ad260a3e..3cbcf3a3e20ac596da755c14ffe222187fea3233 100644 (file)
@@ -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;