Skip to content

Commit

Permalink
mm/interval_tree.c: use vma_pages() helper
Browse files Browse the repository at this point in the history
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/[email protected]
Signed-off-by: Vasyl Gomonovych <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Acked-by: Davidlohr Bueso <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Carmichael561 authored and torvalds committed Feb 1, 2018
1 parent 235266b commit e025f05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/interval_tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e025f05

Please sign in to comment.