From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f72.google.com (mail-oi0-f72.google.com [209.85.218.72]) by kanga.kvack.org (Postfix) with ESMTP id 762C66B02A6 for ; Wed, 22 Nov 2017 10:32:37 -0500 (EST) Received: by mail-oi0-f72.google.com with SMTP id e142so7729755oih.5 for ; Wed, 22 Nov 2017 07:32:37 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id w6si6471689oif.445.2017.11.22.07.32.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Nov 2017 07:32:36 -0800 (PST) Date: Wed, 22 Nov 2017 17:32:34 +0200 From: "Michael S. Tsirkin" Subject: Re: [PATCH] mm: Use vma_pages helper Message-ID: <20171122173227-mutt-send-email-mst@kernel.org> References: <1511364410-13499-1-git-send-email-gomonovych@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1511364410-13499-1-git-send-email-gomonovych@gmail.com> Sender: owner-linux-mm@kvack.org List-ID: To: Vasyl Gomonovych Cc: dledford@redhat.com, dave@stgolabs.net, jglisse@redhat.com, peterz@infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org 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 Acked-by: Michael S. Tsirkin > --- > 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