Commit b4f4a275 authored by Thomas Meyer's avatar Thomas Meyer Committed by Will Deacon

arm64: dma-mapping: Cocci spatch "vma_pages"

Use vma_pages function on vma object instead of explicit computation.
Found by coccinelle spatch "api/vma_pages.cocci"
Reviewed-by: default avatarRobin Murphy <robin.murphy@arm.com>
Signed-off-by: default avatarThomas Meyer <thomas@m3y3r.de>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
parent c2f0b54f
...@@ -303,8 +303,7 @@ static int __swiotlb_mmap_pfn(struct vm_area_struct *vma, ...@@ -303,8 +303,7 @@ static int __swiotlb_mmap_pfn(struct vm_area_struct *vma,
unsigned long pfn, size_t size) unsigned long pfn, size_t size)
{ {
int ret = -ENXIO; int ret = -ENXIO;
unsigned long nr_vma_pages = (vma->vm_end - vma->vm_start) >> unsigned long nr_vma_pages = vma_pages(vma);
PAGE_SHIFT;
unsigned long nr_pages = PAGE_ALIGN(size) >> PAGE_SHIFT; unsigned long nr_pages = PAGE_ALIGN(size) >> PAGE_SHIFT;
unsigned long off = vma->vm_pgoff; unsigned long off = vma->vm_pgoff;
......
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