lkml.org 
[lkml]   [2017]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] metag: Use vma_pages helper in dma_mmap
Date
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
\
 
 \ /
  Last update: 2017-11-23 00:11    [W:0.022 / U:0.344 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site