Skip to content

Commit

Permalink
MIPS: 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"

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/17333/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Thomas Meyer authored and Ralf Baechle committed Oct 9, 2017
1 parent 8a5776a commit 7a8e415
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/mips/mm/dma-default.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ static int mips_dma_mmap(struct device *dev, struct vm_area_struct *vma,
void *cpu_addr, dma_addr_t dma_addr, size_t size,
unsigned long attrs)
{
unsigned long user_count = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
unsigned long user_count = vma_pages(vma);
unsigned long count = PAGE_ALIGN(size) >> PAGE_SHIFT;
unsigned long addr = (unsigned long)cpu_addr;
unsigned long off = vma->vm_pgoff;
Expand Down

0 comments on commit 7a8e415

Please sign in to comment.