Skip to content

Commit

Permalink
ARM: 8763/1: dma-mapping: Use vma_pages()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Fabio Estevam authored and Russell King committed May 19, 2018
1 parent 046835b commit a70c3ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm/mm/dma-mapping.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a70c3ee

Please sign in to comment.