From: Vladimir Murzin <vladimir.murzin@arm.com>
To: Vasyl Gomonovych <gomonovych@gmail.com>,
linux@armlinux.org.uk, jroedel@suse.de,
linux-arm-kernel@lists.infradead.org, sricharan@codeaurora.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ARM: dma-mapping: Use vma_pages helper
Date: Wed, 22 Nov 2017 15:26:40 +0000 [thread overview]
Message-ID: <705681db-b38d-95bd-7986-0c4bfdaf02de@arm.com> (raw)
In-Reply-To: <1511364050-912-1-git-send-email-gomonovych@gmail.com>
On 22/11/17 15:20, Vasyl Gomonovych wrote:
> Use vma_pages function on vma object instead of explicit computation.
> arch/arm/mm/dma-mapping.c:849:36-42: WARNING: Consider using vma_pages helper on vma
> Generated by: scripts/coccinelle/api/vma_pages.cocci
>
> Signed-off-by: Vasyl Gomonovych <gomonovych@gmail.com>
> ---
> arch/arm/mm/dma-mapping.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
> index fcf1473d6fed..855427620b01 100644
> --- a/arch/arm/mm/dma-mapping.c
> +++ b/arch/arm/mm/dma-mapping.c
> @@ -846,7 +846,7 @@ static int __arm_dma_mmap(struct device *dev, struct vm_area_struct *vma,
> unsigned long attrs)
> {
> int ret;
> - unsigned long nr_vma_pages = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
> + unsigned long nr_vma_pages = vma_pages(vma);
> unsigned long nr_pages = PAGE_ALIGN(size) >> PAGE_SHIFT;
> unsigned long pfn = dma_to_pfn(dev, dma_addr);
> unsigned long off = vma->vm_pgoff;
>
Colin already submitted similar patch a couple days ago [1].
[1] https://lkml.org/lkml/2017/11/19/322
Vladimir
prev parent reply other threads:[~2017-11-22 15:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-22 15:20 Vasyl Gomonovych
2017-11-22 15:26 ` Vladimir Murzin [this message]
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=705681db-b38d-95bd-7986-0c4bfdaf02de@arm.com \
--to=vladimir.murzin@arm.com \
--cc=gomonovych@gmail.com \
--cc=jroedel@suse.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=sricharan@codeaurora.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®