Commit e688f144 authored by Muhammad Falak R Wani's avatar Muhammad Falak R Wani Committed by Greg Kroah-Hartman

drivers: dma-coherent: use vma_pages().

Replace explicit computation of vma page count by a call to
vma_pages()
Signed-off-by: default avatarMuhammad Falak R Wani <falakreyaz@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 03aca7b2
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment