From: Geliang Tang <geliangtang@gmail.com>
To: Russell King <linux@armlinux.org.uk>,
Joerg Roedel <jroedel@suse.de>,
Robin Murphy <Robin.Murphy@arm.com>,
Will Deacon <will.deacon@arm.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: Geliang Tang <geliangtang@gmail.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] arm/dma-mapping: use for_each_sg
Date: Fri, 24 Mar 2017 22:12:23 +0800 [thread overview]
Message-ID: <e9923f7ea2c0fd866efb48be52ffe91d25dd0290.1490326970.git.geliangtang@gmail.com> (raw)
Use for_each_sg() instead of open-coding it.
Signed-off-by: Geliang Tang <geliangtang@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 63eabb0..e551351 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -1720,7 +1720,7 @@ static int __map_sg_chunk(struct device *dev, struct scatterlist *sg,
if (iova == DMA_ERROR_CODE)
return -ENOMEM;
- for (count = 0, s = sg; count < (size >> PAGE_SHIFT); s = sg_next(s)) {
+ for_each_sg(sg, s, size >> PAGE_SHIFT, count) {
phys_addr_t phys = page_to_phys(sg_page(s));
unsigned int len = PAGE_ALIGN(s->offset + s->length);
--
2.9.3
next reply other threads:[~2017-03-24 14:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-24 14:12 Geliang Tang [this message]
2017-03-24 14:12 ` [PATCH] [media] ivtv: " Geliang Tang
2017-03-24 14:48 ` [PATCH] arm/dma-mapping: " Russell King - ARM Linux
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=e9923f7ea2c0fd866efb48be52ffe91d25dd0290.1490326970.git.geliangtang@gmail.com \
--to=geliangtang@gmail.com \
--cc=Robin.Murphy@arm.com \
--cc=akpm@linux-foundation.org \
--cc=jroedel@suse.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=will.deacon@arm.com \
/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®