microblaze: Cocci spatch "vma_pages"
authorThomas Meyer <thomas@m3y3r.de>
Wed, 20 Sep 2017 22:29:36 +0000 (00:29 +0200)
committerMichal Simek <michal.simek@xilinx.com>
Mon, 25 Sep 2017 13:29:39 +0000 (15:29 +0200)
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>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
arch/microblaze/kernel/dma.c

index e45ada8fb00669a8889284db230908ed64f2dda1..94700c5270a91e69cb0acb7b32b20f272899a1a6 100644 (file)
@@ -165,7 +165,7 @@ int dma_direct_mmap_coherent(struct device *dev, struct vm_area_struct *vma,
                             unsigned long attrs)
 {
 #ifdef CONFIG_MMU
-       unsigned long user_count = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
+       unsigned long user_count = vma_pages(vma);
        unsigned long count = PAGE_ALIGN(size) >> PAGE_SHIFT;
        unsigned long off = vma->vm_pgoff;
        unsigned long pfn;