summaryrefslogtreecommitdiff
path: root/drivers/media/pci/ivtv/ivtv-udma.c
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@gmail.com>2017-03-24 17:12:24 +0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-04-05 21:17:15 +0300
commitacf0e531a48bdf805fec024dcc2735a61933a213 (patch)
tree0b56eac932a364e1a43744cf8d41c4bd9e5db43a /drivers/media/pci/ivtv/ivtv-udma.c
parente5c27ef390a5195d54ed8135148253ec990ad29a (diff)
downloadlinux-acf0e531a48bdf805fec024dcc2735a61933a213.tar.xz
[media] ivtv: use for_each_sg
Use for_each_sg() instead of open-coding it. Signed-off-by: Geliang Tang <geliangtang@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/pci/ivtv/ivtv-udma.c')
-rw-r--r--drivers/media/pci/ivtv/ivtv-udma.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/pci/ivtv/ivtv-udma.c b/drivers/media/pci/ivtv/ivtv-udma.c
index 2c9232ef7baa..3b33e87ed73b 100644
--- a/drivers/media/pci/ivtv/ivtv-udma.c
+++ b/drivers/media/pci/ivtv/ivtv-udma.c
@@ -76,7 +76,7 @@ void ivtv_udma_fill_sg_array (struct ivtv_user_dma *dma, u32 buffer_offset, u32
int i;
struct scatterlist *sg;
- for (i = 0, sg = dma->SGlist; i < dma->SG_length; i++, sg = sg_next(sg)) {
+ for_each_sg(dma->SGlist, sg, dma->SG_length, i) {
dma->SGarray[i].size = cpu_to_le32(sg_dma_len(sg));
dma->SGarray[i].src = cpu_to_le32(sg_dma_address(sg));
dma->SGarray[i].dst = cpu_to_le32(buffer_offset);