lkml.org 
[lkml]   [2017]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm: Use vma_pages helper
On Wed, Nov 22, 2017 at 04:26:50PM +0100, Vasyl Gomonovych wrote:
> Use vma_pages function on vma object instead of explicit computation.
> mm/interval_tree.c:21:27-33: WARNING: Consider using vma_pages helper
> Generated by: scripts/coccinelle/api/vma_pages.cocci
>
> Signed-off-by: Vasyl Gomonovych <gomonovych@gmail.com>


Acked-by: Michael S. Tsirkin <mst@redhat.com>

> ---
> mm/interval_tree.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/interval_tree.c b/mm/interval_tree.c
> index b47664358796..27ddfd29112a 100644
> --- a/mm/interval_tree.c
> +++ b/mm/interval_tree.c
> @@ -18,7 +18,7 @@ static inline unsigned long vma_start_pgoff(struct vm_area_struct *v)
>
> static inline unsigned long vma_last_pgoff(struct vm_area_struct *v)
> {
> - return v->vm_pgoff + ((v->vm_end - v->vm_start) >> PAGE_SHIFT) - 1;
> + return v->vm_pgoff + vma_pages(v) - 1;
> }
>
> INTERVAL_TREE_DEFINE(struct vm_area_struct, shared.rb,
> --
> 1.9.1

\
 
 \ /
  Last update: 2017-11-22 16:33    [W:0.034 / U:2.600 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site