From: Thomas Meyer <thomas@m3y3r.de>
To: linux-metag@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 3/7] metag: Cocci spatch "vma_pages"
Date: Thu, 21 Sep 2017 00:29:36 +0200 [thread overview]
Message-ID: <1505946334393-100691500-3-diffsplit-thomas@m3y3r.de> (raw)
In-Reply-To: <1505946334393-568186305-0-diffsplit-thomas@m3y3r.de>
Use vma_pages function on vma object instead of explicit computation.
Found by coccinelle spatch "api/vma_pages.cocci"
Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
---
diff -u -p a/arch/metag/kernel/dma.c b/arch/metag/kernel/dma.c
--- a/arch/metag/kernel/dma.c
+++ b/arch/metag/kernel/dma.c
@@ -342,7 +342,7 @@ static int metag_dma_mmap(struct device
else
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
- user_size = (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
+ user_size = vma_pages(vma);
spin_lock_irqsave(&consistent_lock, flags);
c = metag_vm_region_find(&consistent_head, (unsigned long)cpu_addr);
parent reply other threads:[~2017-09-20 22:29 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <1505946334393-568186305-0-diffsplit-thomas@m3y3r.de>]
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=1505946334393-100691500-3-diffsplit-thomas@m3y3r.de \
--to=thomas@m3y3r.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-metag@vger.kernel.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).