[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20220219021441.29173-1-linmiaohe@huawei.com>
Date: Sat, 19 Feb 2022 10:14:41 +0800
From: Miaohe Lin <linmiaohe@...wei.com>
To: <akpm@...ux-foundation.org>
CC: <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>,
<linmiaohe@...wei.com>
Subject: [PATCH] mm: 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.
Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
---
mm/memory.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/memory.c b/mm/memory.c
index 13a2fe911bf8..02ddd6660549 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1700,7 +1700,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;
--
2.23.0
Powered by blists - more mailing lists