Skip to content

Commit

Permalink
drm/xe/oa: Use vma_pages() helper function in xe_oa_mmap()
Browse files Browse the repository at this point in the history
Use the vma_pages() helper function and remove the following
Coccinelle/coccicheck warning reported by vma_pages.cocci:

  WARNING: Consider using vma_pages helper on vma

Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240819095751.539645-2-thorsten.blum@toblux.com
  • Loading branch information
Thorsten Blum authored and Ashutosh Dixit committed Aug 19, 2024
1 parent cb8f81c commit 6841a26
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/gpu/drm/xe/xe_oa.c
Original file line number Diff line number Diff line change
Expand Up @@ -1244,8 +1244,7 @@ static int xe_oa_mmap(struct file *file, struct vm_area_struct *vma)
vm_flags_mod(vma, VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP | VM_DONTCOPY,
VM_MAYWRITE | VM_MAYEXEC);

xe_assert(stream->oa->xe, bo->ttm.ttm->num_pages ==
(vma->vm_end - vma->vm_start) >> PAGE_SHIFT);
xe_assert(stream->oa->xe, bo->ttm.ttm->num_pages == vma_pages(vma));
for (i = 0; i < bo->ttm.ttm->num_pages; i++) {
ret = remap_pfn_range(vma, start, page_to_pfn(bo->ttm.ttm->pages[i]),
PAGE_SIZE, vma->vm_page_prot);
Expand Down

0 comments on commit 6841a26

Please sign in to comment.