Commit 27d420bc authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

mtip32xxx: use for_each_sg

Use the proper helper instead of manually iterating the scatterlist,
which is broken in the presence of chained S/G lists.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent d85cb204
...@@ -1549,11 +1549,11 @@ static inline void fill_command_sg(struct driver_data *dd, ...@@ -1549,11 +1549,11 @@ static inline void fill_command_sg(struct driver_data *dd,
int n; int n;
unsigned int dma_len; unsigned int dma_len;
struct mtip_cmd_sg *command_sg; struct mtip_cmd_sg *command_sg;
struct scatterlist *sg = command->sg; struct scatterlist *sg;
command_sg = command->command + AHCI_CMD_TBL_HDR_SZ; command_sg = command->command + AHCI_CMD_TBL_HDR_SZ;
for (n = 0; n < nents; n++) { for_each_sg(command->sg, sg, nents, n) {
dma_len = sg_dma_len(sg); dma_len = sg_dma_len(sg);
if (dma_len > 0x400000) if (dma_len > 0x400000)
dev_err(&dd->pdev->dev, dev_err(&dd->pdev->dev,
...@@ -1563,7 +1563,6 @@ static inline void fill_command_sg(struct driver_data *dd, ...@@ -1563,7 +1563,6 @@ static inline void fill_command_sg(struct driver_data *dd,
command_sg->dba_upper = command_sg->dba_upper =
cpu_to_le32((sg_dma_address(sg) >> 16) >> 16); cpu_to_le32((sg_dma_address(sg) >> 16) >> 16);
command_sg++; command_sg++;
sg++;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment