linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: MM: Simplify using vma_pages function
@ 2015-11-24  7:38 Mutharaju, Prasanna (P.)
  2015-11-25 11:02 ` Marek Szyprowski
  0 siblings, 1 reply; 2+ messages in thread
From: Mutharaju, Prasanna (P.) @ 2015-11-24  7:38 UTC (permalink / raw)
  To: linux-arm-kernel

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

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

end of thread, other threads:[~2015-11-25 11:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-24  7:38 [PATCH] ARM: MM: Simplify using vma_pages function Mutharaju, Prasanna (P.)
2015-11-25 11:02 ` Marek Szyprowski

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).