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


Groups > linux.kernel > #1736210 > unrolled thread

[PATCH 1/7] ARM: dma-mapping: Cocci spatch "vma_pages"

Started byThomas Meyer <thomas@m3y3r.de>
First post2017-09-21 00:50 +0200
Last post2017-09-21 00:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 1/7] ARM: dma-mapping: Cocci spatch "vma_pages" Thomas Meyer <thomas@m3y3r.de> - 2017-09-21 00:50 +0200

#1736210 — [PATCH 1/7] ARM: dma-mapping: Cocci spatch "vma_pages"

FromThomas Meyer <thomas@m3y3r.de>
Date2017-09-21 00:50 +0200
Subject[PATCH 1/7] ARM: dma-mapping: Cocci spatch "vma_pages"
Message-ID<urVYC-MK-13@gated-at.bofh.it>
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/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -846,7 +846,7 @@ static int __arm_dma_mmap(struct device
 		 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;

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web