linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: Use vma_pages helper
@ 2017-11-22 15:26 Vasyl Gomonovych
  2017-11-22 15:32 ` Michael S. Tsirkin
  2017-11-22 16:43 ` Davidlohr Bueso
  0 siblings, 2 replies; 3+ messages in thread
From: Vasyl Gomonovych @ 2017-11-22 15:26 UTC (permalink / raw)
  To: dledford, dave, mst, jglisse, peterz, linux-mm; +Cc: linux-kernel, gomonovych

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>
---
 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

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-11-22 16:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-22 15:26 [PATCH] mm: Use vma_pages helper Vasyl Gomonovych
2017-11-22 15:32 ` Michael S. Tsirkin
2017-11-22 16:43 ` Davidlohr Bueso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox