summaryrefslogtreecommitdiff
path: root/arch/arm64/mm
diff options
context:
space:
mode:
authorThomas Meyer <thomas@m3y3r.de>2017-09-21 00:29:36 +0200
committerWill Deacon <will.deacon@arm.com>2017-10-02 10:13:05 +0100
commitb4f4a2755665bf847231050b569f587ce0945482 (patch)
tree7da465b14e04b907f9d0054af885050eea8ed11f /arch/arm64/mm
parentc2f0b54f10b12620c57f6e31233589b704a00ed5 (diff)
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: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/mm')
-rw-r--r--arch/arm64/mm/dma-mapping.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c
index 614af886b7ef..5f62090bda24 100644
--- a/arch/arm64/mm/dma-mapping.c
+++ b/arch/arm64/mm/dma-mapping.c
@@ -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;