From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f71.google.com (mail-lf0-f71.google.com [209.85.215.71]) by kanga.kvack.org (Postfix) with ESMTP id B04916B02A1 for ; Wed, 22 Nov 2017 10:27:00 -0500 (EST) Received: by mail-lf0-f71.google.com with SMTP id s13so3986725lfs.5 for ; Wed, 22 Nov 2017 07:27:00 -0800 (PST) Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id s28sor2458921lfi.95.2017.11.22.07.26.58 for (Google Transport Security); Wed, 22 Nov 2017 07:26:58 -0800 (PST) From: Vasyl Gomonovych Subject: [PATCH] mm: Use vma_pages helper Date: Wed, 22 Nov 2017 16:26:50 +0100 Message-Id: <1511364410-13499-1-git-send-email-gomonovych@gmail.com> Sender: owner-linux-mm@kvack.org List-ID: To: dledford@redhat.com, dave@stgolabs.net, mst@redhat.com, jglisse@redhat.com, peterz@infradead.org, linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, gomonovych@gmail.com 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 --- 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: email@kvack.org