[PATCH 18/94] mm/migrate: Use vma_lookup() in do_pages_stat_array()

From: Liam Howlett
Date: Wed Apr 28 2021 - 11:37:42 EST


Using vma_lookup() allows for cleaner and more clear code.

Signed-off-by: Liam R. Howlett <Liam.Howlett@xxxxxxxxxx>
---
mm/migrate.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/migrate.c b/mm/migrate.c
index b234c3f3acb7..611781c0f9b5 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1833,8 +1833,8 @@ static void do_pages_stat_array(struct mm_struct *mm, unsigned long nr_pages,
struct page *page;
int err = -EFAULT;

- vma = find_vma(mm, addr);
- if (!vma || addr < vma->vm_start)
+ vma = vma_lookup(mm, addr);
+ if (!vma)
goto set_status;

/* FOLL_DUMP to ignore special (like zero) pages */
--
2.30.2