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


Groups > linux.kernel > #1736211 > unrolled thread

[PATCH 0/7] Cocci spatch "vma_pages" - v4.14-rc1

Started byThomas Meyer <thomas@m3y3r.de>
First post2017-09-21 00:50 +0200
Last post2017-09-25 15:40 +0200
Articles 5 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [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

#1736211 — [PATCH 0/7] Cocci spatch "vma_pages" - v4.14-rc1

FromThomas Meyer <thomas@m3y3r.de>
Date2017-09-21 00:50 +0200
Subject[PATCH 0/7] Cocci spatch "vma_pages" - v4.14-rc1
Message-ID<urVOV-J7-3@gated-at.bofh.it>
Use vma_pages function on vma object instead of explicit computation.

Found by coccinelle spatch "api/vma_pages.cocci"

Run against version v4.14-rc1

Let me know when you as a maintainer are not interested in these kind of patches.
I can exclude you by path; e.g. all findings in "drivers/scsi" will never
be reported again by this semi-automatic program runs.

[toc] | [next] | [standalone]


#1736212 — [PATCH 2/7] arm64: Cocci spatch "vma_pages"

FromThomas Meyer <thomas@m3y3r.de>
Date2017-09-21 00:50 +0200
Subject[PATCH 2/7] arm64: Cocci spatch "vma_pages"
Message-ID<urVYC-MK-15@gated-at.bofh.it>
In reply to#1736211
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;
 

[toc] | [prev] | [next] | [standalone]


#1739812 — Re: [PATCH 2/7] arm64: Cocci spatch "vma_pages"

FromRobin Murphy <robin.murphy@arm.com>
Date2017-09-26 14:00 +0200
SubjectRe: [PATCH 2/7] arm64: Cocci spatch "vma_pages"
Message-ID<utWGS-4jM-23@gated-at.bofh.it>
In reply to#1736212
On 20/09/17 23:29, Thomas Meyer wrote:
> Use vma_pages function on vma object instead of explicit computation.
> Found by coccinelle spatch "api/vma_pages.cocci"

Reviewed-by: Robin Murphy <robin.murphy@arm.com>

I guess this can be picked up independently of the other patches?

Robin.

> 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;
>  
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

[toc] | [prev] | [next] | [standalone]


#1736215 — [PATCH 4/7] microblaze: Cocci spatch "vma_pages"

FromThomas Meyer <thomas@m3y3r.de>
Date2017-09-21 00:50 +0200
Subject[PATCH 4/7] microblaze: Cocci spatch "vma_pages"
Message-ID<urVYC-MK-23@gated-at.bofh.it>
In reply to#1736211
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/microblaze/kernel/dma.c b/arch/microblaze/kernel/dma.c
--- a/arch/microblaze/kernel/dma.c
+++ b/arch/microblaze/kernel/dma.c
@@ -165,7 +165,7 @@ int dma_direct_mmap_coherent(struct devi
 			     unsigned long attrs)
 {
 #ifdef CONFIG_MMU
-	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 off = vma->vm_pgoff;
 	unsigned long pfn;

[toc] | [prev] | [next] | [standalone]


#1739060 — Re: [PATCH 4/7] microblaze: Cocci spatch "vma_pages"

FromMichal Simek <monstr@monstr.eu>
Date2017-09-25 15:40 +0200
SubjectRe: [PATCH 4/7] microblaze: Cocci spatch "vma_pages"
Message-ID<utBM5-6Z8-17@gated-at.bofh.it>
In reply to#1736215

[Multipart message — attachments visible in raw view] — view raw

On 21.9.2017 00:29, Thomas Meyer wrote:
> 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/microblaze/kernel/dma.c b/arch/microblaze/kernel/dma.c
> --- a/arch/microblaze/kernel/dma.c
> +++ b/arch/microblaze/kernel/dma.c
> @@ -165,7 +165,7 @@ int dma_direct_mmap_coherent(struct devi
>  			     unsigned long attrs)
>  {
>  #ifdef CONFIG_MMU
> -	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 off = vma->vm_pgoff;
>  	unsigned long pfn;
> 

Applied to mb/next.

Thanks,
Michal

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP SoCs


[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web