From: "Michael S. Tsirkin" <mst@redhat.com>
To: Vasyl Gomonovych <gomonovych@gmail.com>
Cc: dledford@redhat.com, dave@stgolabs.net, jglisse@redhat.com,
peterz@infradead.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: Use vma_pages helper
Date: Wed, 22 Nov 2017 17:32:34 +0200 [thread overview]
Message-ID: <20171122173227-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <1511364410-13499-1-git-send-email-gomonovych@gmail.com>
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 <gomonovych@gmail.com>
Acked-by: Michael S. Tsirkin <mst@redhat.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>
WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Vasyl Gomonovych <gomonovych@gmail.com>
Cc: dledford@redhat.com, dave@stgolabs.net, jglisse@redhat.com,
peterz@infradead.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: Use vma_pages helper
Date: Wed, 22 Nov 2017 17:32:34 +0200 [thread overview]
Message-ID: <20171122173227-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <1511364410-13499-1-git-send-email-gomonovych@gmail.com>
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 <gomonovych@gmail.com>
Acked-by: Michael S. Tsirkin <mst@redhat.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
next prev parent reply other threads:[~2017-11-22 15:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-22 15:26 [PATCH] mm: Use vma_pages helper Vasyl Gomonovych
2017-11-22 15:26 ` Vasyl Gomonovych
2017-11-22 15:32 ` Michael S. Tsirkin [this message]
2017-11-22 15:32 ` Michael S. Tsirkin
2017-11-22 16:43 ` Davidlohr Bueso
2017-11-22 16:43 ` Davidlohr Bueso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171122173227-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=dave@stgolabs.net \
--cc=dledford@redhat.com \
--cc=gomonovych@gmail.com \
--cc=jglisse@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.