Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1736196

[PATCH 5/7] MIPS: Cocci spatch "vma_pages"

From Thomas Meyer <thomas@m3y3r.de>
Newsgroups linux.kernel
Subject [PATCH 5/7] MIPS: Cocci spatch "vma_pages"
Date 2017-09-21 00:40 +0200
Message-ID <urVOW-J7-9@gated-at.bofh.it> (permalink)
References <urVOV-J7-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---

diff -u -p a/arch/mips/mm/dma-default.c b/arch/mips/mm/dma-default.c
--- a/arch/mips/mm/dma-default.c
+++ b/arch/mips/mm/dma-default.c
@@ -179,7 +179,7 @@ static int mips_dma_mmap(struct device *
 	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;

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 5/7] MIPS: Cocci spatch "vma_pages" Thomas Meyer <thomas@m3y3r.de> - 2017-09-21 00:40 +0200

csiph-web