]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drivers: dma-coherent: use vma_pages().
authorMuhammad Falak R Wani <falakreyaz@gmail.com>
Sat, 21 May 2016 13:22:57 +0000 (18:52 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Aug 2016 13:13:56 +0000 (15:13 +0200)
Replace explicit computation of vma page count by a call to
vma_pages()

Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/dma-coherent.c

index bdf28f7dd5e8638bfee9f522aef1cbfa71b89cbf..db122a06edc517c2e9e0a15d9364e5d921c3a00a 100644 (file)
@@ -261,7 +261,7 @@ int dma_mmap_from_coherent(struct device *dev, struct vm_area_struct *vma,
                   (mem->virt_base + (mem->size << PAGE_SHIFT))) {
                unsigned long off = vma->vm_pgoff;
                int start = (vaddr - mem->virt_base) >> PAGE_SHIFT;
-               int user_count = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
+               int user_count = vma_pages(vma);
                int count = size >> PAGE_SHIFT;
 
                *ret = -ENXIO;