LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* Cocci spatch "vma_pages" - v5.2-rc1
@ 2019-05-29 20:10 Thomas Meyer
  2019-05-29 20:11 ` [PATCH] vfio-pci/nvlink2: Use vma_pages function instead of explicit computation Thomas Meyer
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Meyer @ 2019-05-29 20:10 UTC (permalink / raw)
  To: linux-kernel

Use vma_pages function on vma object instead of explicit computation.

Found by coccinelle spatch "api/vma_pages.cocci"

Run against version v5.2-rc1

P.S. If you find this email unwanted, set up a procmail rule junking on
the header:

X-Patch: Cocci

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] vfio-pci/nvlink2: Use vma_pages function instead of explicit computation
  2019-05-29 20:10 Cocci spatch "vma_pages" - v5.2-rc1 Thomas Meyer
@ 2019-05-29 20:11 ` Thomas Meyer
  2019-05-29 21:23   ` Alex Williamson
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Meyer @ 2019-05-29 20:11 UTC (permalink / raw)
  To: alex.williamson, kvm, linux-kernel

Use vma_pages function on vma object instead of explicit computation.

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
---

diff -u -p a/drivers/vfio/pci/vfio_pci_nvlink2.c b/drivers/vfio/pci/vfio_pci_nvlink2.c
--- a/drivers/vfio/pci/vfio_pci_nvlink2.c
+++ b/drivers/vfio/pci/vfio_pci_nvlink2.c
@@ -161,7 +161,7 @@ static int vfio_pci_nvgpu_mmap(struct vf
 
 	atomic_inc(&data->mm->mm_count);
 	ret = (int) mm_iommu_newdev(data->mm, data->useraddr,
-			(vma->vm_end - vma->vm_start) >> PAGE_SHIFT,
+			vma_pages(vma),
 			data->gpu_hpa, &data->mem);
 
 	trace_vfio_pci_nvgpu_mmap(vdev->pdev, data->gpu_hpa, data->useraddr,

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] vfio-pci/nvlink2: Use vma_pages function instead of explicit computation
  2019-05-29 20:11 ` [PATCH] vfio-pci/nvlink2: Use vma_pages function instead of explicit computation Thomas Meyer
@ 2019-05-29 21:23   ` Alex Williamson
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Williamson @ 2019-05-29 21:23 UTC (permalink / raw)
  To: Thomas Meyer; +Cc: kvm, linux-kernel

On Wed, 29 May 2019 22:11:06 +0200
"Thomas Meyer" <thomas@m3y3r.de> wrote:

> Use vma_pages function on vma object instead of explicit computation.
> 
> Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
> ---
> 
> diff -u -p a/drivers/vfio/pci/vfio_pci_nvlink2.c b/drivers/vfio/pci/vfio_pci_nvlink2.c
> --- a/drivers/vfio/pci/vfio_pci_nvlink2.c
> +++ b/drivers/vfio/pci/vfio_pci_nvlink2.c
> @@ -161,7 +161,7 @@ static int vfio_pci_nvgpu_mmap(struct vf
>  
>  	atomic_inc(&data->mm->mm_count);
>  	ret = (int) mm_iommu_newdev(data->mm, data->useraddr,
> -			(vma->vm_end - vma->vm_start) >> PAGE_SHIFT,
> +			vma_pages(vma),
>  			data->gpu_hpa, &data->mem);
>  
>  	trace_vfio_pci_nvgpu_mmap(vdev->pdev, data->gpu_hpa, data->useraddr,

Not sure if our emails crossed in flight[1], but the other patch[2]
still has precedence.  You're welcome to add a reviewed-by.  Thanks,

Alex

[1]https://lkml.org/lkml/2019/5/29/871
[2]https://lkml.org/lkml/2019/5/16/658

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-29 21:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-29 20:10 Cocci spatch "vma_pages" - v5.2-rc1 Thomas Meyer
2019-05-29 20:11 ` [PATCH] vfio-pci/nvlink2: Use vma_pages function instead of explicit computation Thomas Meyer
2019-05-29 21:23   ` Alex Williamson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).