Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1608466

[PATCH] [media] ivtv: use for_each_sg

From Geliang Tang <geliangtang@gmail.com>
Newsgroups linux.kernel
Subject [PATCH] [media] ivtv: use for_each_sg
Date 2017-03-24 15:20 +0100
Message-ID <toyeo-2LK-75@gated-at.bofh.it> (permalink)
References <toyel-2LK-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Use for_each_sg() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
 drivers/media/pci/ivtv/ivtv-udma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/pci/ivtv/ivtv-udma.c b/drivers/media/pci/ivtv/ivtv-udma.c
index 2c9232e..3b33e87 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);
-- 
2.9.3

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] arm/dma-mapping: use for_each_sg Geliang Tang <geliangtang@gmail.com> - 2017-03-24 15:20 +0100
  [PATCH] [media] ivtv: use for_each_sg Geliang Tang <geliangtang@gmail.com> - 2017-03-24 15:20 +0100
  Re: [PATCH] arm/dma-mapping: use for_each_sg Russell King - ARM Linux <linux@armlinux.org.uk> - 2017-03-24 15:50 +0100

csiph-web