diff options
Diffstat (limited to 'drivers/ata/sata_qstor.c')
-rw-r--r-- | drivers/ata/sata_qstor.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/ata/sata_qstor.c b/drivers/ata/sata_qstor.c index 4e5f07bdd069..91cc12c82040 100644 --- a/drivers/ata/sata_qstor.c +++ b/drivers/ata/sata_qstor.c | |||
@@ -287,14 +287,10 @@ static unsigned int qs_fill_sg(struct ata_queued_cmd *qc) | |||
287 | struct scatterlist *sg; | 287 | struct scatterlist *sg; |
288 | struct ata_port *ap = qc->ap; | 288 | struct ata_port *ap = qc->ap; |
289 | struct qs_port_priv *pp = ap->private_data; | 289 | struct qs_port_priv *pp = ap->private_data; |
290 | unsigned int nelem; | ||
291 | u8 *prd = pp->pkt + QS_CPB_BYTES; | 290 | u8 *prd = pp->pkt + QS_CPB_BYTES; |
291 | unsigned int si; | ||
292 | 292 | ||
293 | WARN_ON(qc->__sg == NULL); | 293 | for_each_sg(qc->sg, sg, qc->n_elem, si) { |
294 | WARN_ON(qc->n_elem == 0 && qc->pad_len == 0); | ||
295 | |||
296 | nelem = 0; | ||
297 | ata_for_each_sg(sg, qc) { | ||
298 | u64 addr; | 294 | u64 addr; |
299 | u32 len; | 295 | u32 len; |
300 | 296 | ||
@@ -306,12 +302,11 @@ static unsigned int qs_fill_sg(struct ata_queued_cmd *qc) | |||
306 | *(__le32 *)prd = cpu_to_le32(len); | 302 | *(__le32 *)prd = cpu_to_le32(len); |
307 | prd += sizeof(u64); | 303 | prd += sizeof(u64); |
308 | 304 | ||
309 | VPRINTK("PRD[%u] = (0x%llX, 0x%X)\n", nelem, | 305 | VPRINTK("PRD[%u] = (0x%llX, 0x%X)\n", si, |
310 | (unsigned long long)addr, len); | 306 | (unsigned long long)addr, len); |
311 | nelem++; | ||
312 | } | 307 | } |
313 | 308 | ||
314 | return nelem; | 309 | return si; |
315 | } | 310 | } |
316 | 311 | ||
317 | static void qs_qc_prep(struct ata_queued_cmd *qc) | 312 | static void qs_qc_prep(struct ata_queued_cmd *qc) |