lkml.org 
[lkml]   [2017]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 3/7] metag: Cocci spatch "vma_pages"
From
Date
Use vma_pages function on vma object instead of explicit computation.
Found by coccinelle spatch "api/vma_pages.cocci"

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
---

diff -u -p a/arch/metag/kernel/dma.c b/arch/metag/kernel/dma.c
--- a/arch/metag/kernel/dma.c
+++ b/arch/metag/kernel/dma.c
@@ -342,7 +342,7 @@ static int metag_dma_mmap(struct device
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);
\
 
 \ /
  Last update: 2017-09-21 19:24    [W:0.114 / U:7.816 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site