summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Estevam <festevam@gmail.com>2018-04-23 12:30:27 +0100
committerRussell King <rmk+kernel@armlinux.org.uk>2018-05-19 11:53:46 +0100
commita70c3ee34b093bf2b007aceda5b444906f8964c7 (patch)
tree3698eae551f9c02a4c4a61a7437df441302e4604
parent046835b4aa22b9ab6aa0bb274e3b71047c4b887d (diff)
downloadop-kernel-dev-a70c3ee34b093bf2b007aceda5b444906f8964c7.zip
op-kernel-dev-a70c3ee34b093bf2b007aceda5b444906f8964c7.tar.gz
ARM: 8763/1: dma-mapping: Use vma_pages()
Use vma_pages() function instead of open coding it. Generated by scripts/coccinelle/api/vma_pages.cocci. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
-rw-r--r--arch/arm/mm/dma-mapping.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 8c398fe..c25cca6 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -845,7 +845,7 @@ static int __arm_dma_mmap(struct device *dev, struct vm_area_struct *vma,
unsigned long attrs)
{
int ret;
- 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 pfn = dma_to_pfn(dev, dma_addr);
unsigned long off = vma->vm_pgoff;
OpenPOWER on IntegriCloud