Skip to content

Commit

Permalink
arm64: dma-mapping: Cocci spatch "vma_pages"
Browse files Browse the repository at this point in the history
Use vma_pages function on vma object instead of explicit computation.
Found by coccinelle spatch "api/vma_pages.cocci"

Reviewed-by: Robin Murphy <[email protected]>
Signed-off-by: Thomas Meyer <[email protected]>
Signed-off-by: Will Deacon <[email protected]>
  • Loading branch information
thomasmey authored and wildea01 committed Oct 2, 2017
1 parent c2f0b54 commit b4f4a27
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions arch/arm64/mm/dma-mapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,7 @@ static int __swiotlb_mmap_pfn(struct vm_area_struct *vma,
unsigned long pfn, size_t size)
{
int ret = -ENXIO;
unsigned long nr_vma_pages = (vma->vm_end - vma->vm_start) >>
PAGE_SHIFT;
unsigned long nr_vma_pages = vma_pages(vma);
unsigned long nr_pages = PAGE_ALIGN(size) >> PAGE_SHIFT;
unsigned long off = vma->vm_pgoff;

Expand Down

0 comments on commit b4f4a27

Please sign in to comment.