From: Miaohe Lin Subject: mm/migration: use helper function vma_lookup() in add_page_for_migration We could use helper function vma_lookup() to lookup the needed vma to simplify the code. Link: https://lkml.kernel.org/r/20220318111709.60311-6-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Cc: Alistair Popple Cc: Baolin Wang Cc: "Huang, Ying" Cc: Muchun Song Cc: Zi Yan Signed-off-by: Andrew Morton --- mm/migrate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/mm/migrate.c~mm-migration-use-helper-function-vma_lookup-in-add_page_for_migration +++ a/mm/migrate.c @@ -1616,8 +1616,8 @@ static int add_page_for_migration(struct mmap_read_lock(mm); err = -EFAULT; - vma = find_vma(mm, addr); - if (!vma || addr < vma->vm_start || !vma_migratable(vma)) + vma = vma_lookup(mm, addr); + if (!vma || !vma_migratable(vma)) goto out; /* FOLL_DUMP to ignore special (like zero) pages */ _