Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1736212
| From | Thomas Meyer <thomas@m3y3r.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 2/7] arm64: Cocci spatch "vma_pages" |
| Date | 2017-09-21 00:50 +0200 |
| Message-ID | <urVYC-MK-15@gated-at.bofh.it> (permalink) |
| References | <urVOV-J7-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c
--- a/arch/arm64/mm/dma-mapping.c
+++ b/arch/arm64/mm/dma-mapping.c
@@ -303,8 +303,7 @@ static int __swiotlb_mmap_pfn(struct vm_
unsigned long pfn, size_t size)
{
int ret = -ENXIO;
- 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 off = vma->vm_pgoff;
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/7] Cocci spatch "vma_pages" - v4.14-rc1 Thomas Meyer <thomas@m3y3r.de> - 2017-09-21 00:50 +0200
[PATCH 2/7] arm64: Cocci spatch "vma_pages" Thomas Meyer <thomas@m3y3r.de> - 2017-09-21 00:50 +0200
Re: [PATCH 2/7] arm64: Cocci spatch "vma_pages" Robin Murphy <robin.murphy@arm.com> - 2017-09-26 14:00 +0200
[PATCH 4/7] microblaze: Cocci spatch "vma_pages" Thomas Meyer <thomas@m3y3r.de> - 2017-09-21 00:50 +0200
Re: [PATCH 4/7] microblaze: Cocci spatch "vma_pages" Michal Simek <monstr@monstr.eu> - 2017-09-25 15:40 +0200
csiph-web