[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>
This commit is contained in:

committed by
Mauro Carvalho Chehab

부모
6dfa513180
커밋
872dfcfe82
@@ -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));
|
||||
|
Reference in New Issue
Block a user