* [RESEND PATCH] drm/xe/oa: Use vma_pages() helper function in xe_oa_mmap()
@ 2024-08-19 9:57 Thorsten Blum
2024-08-19 14:28 ` Dixit, Ashutosh
0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2024-08-19 9:57 UTC (permalink / raw)
To: lucas.demarchi, thomas.hellstrom, rodrigo.vivi, maarten.lankhorst,
mripard, tzimmermann, airlied, daniel
Cc: intel-xe, dri-devel, linux-kernel, Thorsten Blum, Ashutosh Dixit
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>
---
drivers/gpu/drm/xe/xe_oa.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c
index 6d69f751bf78..133292a9d687 100644
--- a/drivers/gpu/drm/xe/xe_oa.c
+++ b/drivers/gpu/drm/xe/xe_oa.c
@@ -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);
--
2.46.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [RESEND PATCH] drm/xe/oa: Use vma_pages() helper function in xe_oa_mmap()
2024-08-19 9:57 [RESEND PATCH] drm/xe/oa: Use vma_pages() helper function in xe_oa_mmap() Thorsten Blum
@ 2024-08-19 14:28 ` Dixit, Ashutosh
0 siblings, 0 replies; 2+ messages in thread
From: Dixit, Ashutosh @ 2024-08-19 14:28 UTC (permalink / raw)
To: Thorsten Blum
Cc: lucas.demarchi, thomas.hellstrom, rodrigo.vivi, maarten.lankhorst,
mripard, tzimmermann, airlied, daniel, intel-xe, dri-devel,
linux-kernel
On Mon, 19 Aug 2024 02:57:52 -0700, Thorsten Blum wrote:
>
> 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>
Sorry Thorsten, looks like we forgot to merge it last time. I have merged
this just now. Thanks for the patch.
> ---
> drivers/gpu/drm/xe/xe_oa.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c
> index 6d69f751bf78..133292a9d687 100644
> --- a/drivers/gpu/drm/xe/xe_oa.c
> +++ b/drivers/gpu/drm/xe/xe_oa.c
> @@ -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);
> --
> 2.46.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-08-19 14:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-19 9:57 [RESEND PATCH] drm/xe/oa: Use vma_pages() helper function in xe_oa_mmap() Thorsten Blum
2024-08-19 14:28 ` Dixit, Ashutosh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox