lib/scatterlist: use page iterator in the mapping iterator

For better code reuse use the newly added page iterator to iterate
through the pages.  The offset, length within the page is still
calculated by the mapping iterator as well as the actual mapping.  Idea
from Tejun Heo.

Signed-off-by: Imre Deak <[email protected]>
Cc: Maxim Levitsky <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: James Hogan <[email protected]>
Cc: Stephen Warren <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Imre Deak 2013-02-27 17:02:57 -08:00 • committed by Linus Torvalds
commit 4225fc8555
3 changed files with 28 additions and 30 deletions

View file

@ -1453,7 +1453,7 @@ static void dw_mci_read_data_pio(struct dw_mci *host)
if (!sg_miter_next(sg_miter))
goto done;
host->sg = sg_miter->__sg;
host->sg = sg_miter->piter.sg;
buf = sg_miter->addr;
remain = sg_miter->length;
offset = 0;
@ -1508,7 +1508,7 @@ static void dw_mci_write_data_pio(struct dw_mci *host)
if (!sg_miter_next(sg_miter))
goto done;
host->sg = sg_miter->__sg;
host->sg = sg_miter->piter.sg;
buf = sg_miter->addr;
remain = sg_miter->length;
offset = 0;