diff mbox series

[12/94] drm/amdgpu: Use vma_lookup() in amdgpu_ttm_tt_get_user_pages()

Message ID 20210428153542.2814175-13-Liam.Howlett@Oracle.com (mailing list archive)
State New, archived
Headers show
Series Introducing the Maple Tree | expand

Commit Message

Liam R. Howlett April 28, 2021, 3:35 p.m. UTC
Using vma_lookup() allows for cleaner code as the vma start address
validation is not needed, as apposed to find_vma().

Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 3bef0432cac2..bd8df9bc9e38 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -709,8 +709,8 @@  int amdgpu_ttm_tt_get_user_pages(struct amdgpu_bo *bo, struct page **pages)
 	}
 
 	mmap_read_lock(mm);
-	vma = find_vma(mm, start);
-	if (unlikely(!vma || start < vma->vm_start)) {
+	vma = vma_lookup(mm, start);
+	if (unlikely(!vma)) {
 		r = -EFAULT;
 		goto out_unlock;
 	}