All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] metag: Use vma_pages helper in dma_mmap
@ 2017-11-22 23:08 Vasyl Gomonovych
  0 siblings, 0 replies; only message in thread
From: Vasyl Gomonovych @ 2017-11-22 23:08 UTC (permalink / raw)
  To: jhogan, dledford, akpm, bart.vanassche, alexander.h.duyck, linux-metag
  Cc: linux-kernel, gomonovych

Use vma_pages function on vma object instead of explicit computation.
arch/metag/kernel/dma.c:345:19-25: WARNING: Consider using vma_pages helper on vma
Generated by: scripts/coccinelle/api/vma_pages.cocci

Signed-off-by: Vasyl Gomonovych <gomonovych@gmail.com>
---
 arch/metag/kernel/dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/metag/kernel/dma.c b/arch/metag/kernel/dma.c
index f0ab3a498328..49a3b843ef9f 100644
--- a/arch/metag/kernel/dma.c
+++ b/arch/metag/kernel/dma.c
@@ -342,7 +342,7 @@ static int metag_dma_mmap(struct device *dev, struct vm_area_struct *vma,
 	else
 		vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
 
-	user_size = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
+	user_size = vma_pages(vma);
 
 	spin_lock_irqsave(&consistent_lock, flags);
 	c = metag_vm_region_find(&consistent_head, (unsigned long)cpu_addr);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-11-22 23:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-22 23:08 [PATCH] metag: Use vma_pages helper in dma_mmap Vasyl Gomonovych

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.