From: Vasyl Gomonovych Date: Thu, 1 Feb 2018 00:17:03 +0000 (-0800) Subject: mm/interval_tree.c: use vma_pages() helper X-Git-Tag: v4.16-rc1~122^2~70 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e025f059a32085d76768e46eac344cba203a6a71;p=thirdparty%2Flinux.git mm/interval_tree.c: use vma_pages() helper 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 Link: http://lkml.kernel.org/r/1511364410-13499-1-git-send-email-gomonovych@gmail.com Signed-off-by: Vasyl Gomonovych Acked-by: Michael S. Tsirkin Acked-by: Davidlohr Bueso Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/interval_tree.c b/mm/interval_tree.c index b476643587966..27ddfd29112ae 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,