Skip to contentSkip to conversation

mm: use helper function range_in_vma()

PATCH Applied Miaohe Lin 1 participant 1 message Feb 19, 2022

Subsystems (2)
lore
Share & tools
lore

Miaohe Lin

author
#0 lore raw

PATCH 1/1 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.

---
 mm/memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/memory.c +1 -1
index 13a2fe911bf8..02ddd6660549 100644
@@ -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;
 
Signature · 1 line
2.23.0