summaryrefslogtreecommitdiffstats
path: root/drivers/media/pci/cx88
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2014-11-21 07:57:12 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-11-25 08:12:53 -0200
commit872dfcfe82438f5211f5fa1dc6406d033a8a2448 (patch)
treed3a736a51219e493ed94c3ecc203b36168d887fc /drivers/media/pci/cx88
parent6dfa5131804e8cc0866e2f21ed79ce4b08976cff (diff)
downloadlinux-stable-872dfcfe82438f5211f5fa1dc6406d033a8a2448.tar.gz
linux-stable-872dfcfe82438f5211f5fa1dc6406d033a8a2448.tar.bz2
linux-stable-872dfcfe82438f5211f5fa1dc6406d033a8a2448.zip
[media] bttv/cx25821/cx88/ivtv: use sg_next instead of sg++
Never use sg++, always use sg = sg_next(sg). Scatterlist entries can be combined if the memory is contiguous but sg++ won't know about that. As far as I can tell cx88 and ivtv are really broken because of this, and bttv and cx25821 are OK because vb1 doesn't combine scatterlist entries. But regardless, sg++ should never be used, only sg_next is safe. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/pci/cx88')
-rw-r--r--drivers/media/pci/cx88/cx88-core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/pci/cx88/cx88-core.c b/drivers/media/pci/cx88/cx88-core.c
index 9fa4acbdcab8..dee177ed5fe9 100644
--- a/drivers/media/pci/cx88/cx88-core.c
+++ b/drivers/media/pci/cx88/cx88-core.c
@@ -95,7 +95,7 @@ static __le32* cx88_risc_field(__le32 *rp, struct scatterlist *sglist,
for (line = 0; line < lines; line++) {
while (offset && offset >= sg_dma_len(sg)) {
offset -= sg_dma_len(sg);
- sg++;
+ sg = sg_next(sg);
}
if (lpi && line>0 && !(line % lpi))
sol = RISC_SOL | RISC_IRQ1 | RISC_CNT_INC;
@@ -114,13 +114,13 @@ static __le32* cx88_risc_field(__le32 *rp, struct scatterlist *sglist,
*(rp++)=cpu_to_le32(sg_dma_address(sg)+offset);
todo -= (sg_dma_len(sg)-offset);
offset = 0;
- sg++;
+ sg = sg_next(sg);
while (todo > sg_dma_len(sg)) {
*(rp++)=cpu_to_le32(RISC_WRITE|
sg_dma_len(sg));
*(rp++)=cpu_to_le32(sg_dma_address(sg));
todo -= sg_dma_len(sg);
- sg++;
+ sg = sg_next(sg);
}
*(rp++)=cpu_to_le32(RISC_WRITE|RISC_EOL|todo);
*(rp++)=cpu_to_le32(sg_dma_address(sg));