mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Thomas Meyer" <thomas@m3y3r.de>
To: alex.williamson@redhat.com, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] vfio-pci/nvlink2: Use vma_pages function instead of explicit computation
Date: Wed, 29 May 2019 22:11:06 +0200	[thread overview]
Message-ID: <1559160524648-1049343203-1-diffsplit-thomas@m3y3r.de> (raw)
In-Reply-To: <1559160524618-2047588593-0-diffsplit-thomas@m3y3r.de>

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,

  reply	other threads:[~2019-05-29 20:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-29 20:10 Cocci spatch "vma_pages" - v5.2-rc1 Thomas Meyer
2019-05-29 20:11 ` Thomas Meyer [this message]
2019-05-29 21:23   ` [PATCH] vfio-pci/nvlink2: Use vma_pages function instead of explicit computation Alex Williamson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1559160524648-1049343203-1-diffsplit-thomas@m3y3r.de \
    --to=thomas@m3y3r.de \
    --cc=alex.williamson@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®