Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fix an example of scatterlists handling in DMA-API.txt

This example isn't the proper way to handle scatterlists (can't handle
sg chaining).

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>

authored by

FUJITA Tomonori and committed by
Jens Axboe
79eb0145 4ee5eaf4

+1 -1
+1 -1
Documentation/DMA-API.txt
··· 337 337 int i, count = dma_map_sg(dev, sglist, nents, direction); 338 338 struct scatterlist *sg; 339 339 340 - for (i = 0, sg = sglist; i < count; i++, sg++) { 340 + for_each_sg(sglist, sg, count, i) { 341 341 hw_address[i] = sg_dma_address(sg); 342 342 hw_len[i] = sg_dma_len(sg); 343 343 }