Skip to content

Commit e66e02c

Browse files
Peng HaoAlex Williamson
authored andcommitted
vfio: vfio_pci_nvlink2: use a vma helper function
Use a vma helper function to simply code. Signed-off-by: Peng Hao <richard.peng@oppo.com> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
1 parent 4b2dbd5 commit e66e02c

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎drivers/vfio/pci/vfio_pci_nvlink2.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,7 @@ static int vfio_pci_nvgpu_mmap(struct vfio_pci_device *vdev,
161161

162162
atomic_inc(&data->mm->mm_count);
163163
ret = (int) mm_iommu_newdev(data->mm, data->useraddr,
164-
(vma->vm_end - vma->vm_start) >> PAGE_SHIFT,
165-
data->gpu_hpa, &data->mem);
164+
vma_pages(vma), data->gpu_hpa, &data->mem);
166165

167166
trace_vfio_pci_nvgpu_mmap(vdev->pdev, data->gpu_hpa, data->useraddr,
168167
vma->vm_end - vma->vm_start, ret);

0 commit comments

Comments
 (0)