2017-11-22 23:11:51

by Vasyl Gomonovych

[permalink] [raw]
Subject: [PATCH] metag: Use vma_pages helper in dma_mmap

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 <[email protected]>
---
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


From 1584810039824233221@xxx Wed Nov 22 23:17:11 +0000 2017
X-GM-THRID: 1584810039824233221
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread