All of lore.kernel.org
 help / color / mirror / Atom feed
From: mkarthi3@visteon.com (Mutharaju, Prasanna (P.))
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: MM: Simplify using vma_pages function
Date: Tue, 24 Nov 2015 07:38:12 +0000	[thread overview]
Message-ID: <20151124073805.GA23513@jci-VirtualBox> (raw)

From: Prasanna Karthik <mkarthi3@visteon.com>

Use vma_pages function on vma object instead of explicit computation.

Signed-off-by: Prasanna Karthik <mkarthi3@visteon.com>
---
 arch/arm/mm/dma-mapping.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index ad4eb2d..513e213 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -694,7 +694,7 @@ static int __arm_dma_mmap(struct device *dev, struct vm_area_struct *vma,
 {
 	int ret = -ENXIO;
 #ifdef CONFIG_MMU
-	unsigned long nr_vma_pages = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
+	unsigned long nr_vma_pages = vma_pages(vma);
 	unsigned long nr_pages = PAGE_ALIGN(size) >> PAGE_SHIFT;
 	unsigned long pfn = dma_to_pfn(dev, dma_addr);
 	unsigned long off = vma->vm_pgoff;
-- 
1.9.1

             reply	other threads:[~2015-11-24  7:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-24  7:38 Mutharaju, Prasanna (P.) [this message]
2015-11-25 11:02 ` [PATCH] ARM: MM: Simplify using vma_pages function Marek Szyprowski

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=20151124073805.GA23513@jci-VirtualBox \
    --to=mkarthi3@visteon.com \
    --cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.