diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-11-05 15:44:02 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-11-05 15:44:02 -0500 |
commit | 8cedcfd43a0b00741fff43d6a4c1a8b7748db3b0 (patch) | |
tree | 41758e4da78f94a20813554ef9f5ed9b323a4f8c /drivers/scsi/sata_sx4.c | |
parent | cd8200e6d4f9f05e6ea48f7c000be890337396ac (diff) | |
parent | 70d9d825e0a5a78ec1dacaaaf5c72ff5b0206fab (diff) |
Merge branch 'master'
Diffstat (limited to 'drivers/scsi/sata_sx4.c')
-rw-r--r-- | drivers/scsi/sata_sx4.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/scsi/sata_sx4.c b/drivers/scsi/sata_sx4.c index ea921e693689..2bfede324eac 100644 --- a/drivers/scsi/sata_sx4.c +++ b/drivers/scsi/sata_sx4.c | |||
@@ -451,14 +451,14 @@ static inline void pdc20621_host_pkt(struct ata_taskfile *tf, u8 *buf, | |||
451 | 451 | ||
452 | static void pdc20621_dma_prep(struct ata_queued_cmd *qc) | 452 | static void pdc20621_dma_prep(struct ata_queued_cmd *qc) |
453 | { | 453 | { |
454 | struct scatterlist *sg = qc->sg; | 454 | struct scatterlist *sg; |
455 | struct ata_port *ap = qc->ap; | 455 | struct ata_port *ap = qc->ap; |
456 | struct pdc_port_priv *pp = ap->private_data; | 456 | struct pdc_port_priv *pp = ap->private_data; |
457 | void __iomem *mmio = ap->host_set->mmio_base; | 457 | void __iomem *mmio = ap->host_set->mmio_base; |
458 | struct pdc_host_priv *hpriv = ap->host_set->private_data; | 458 | struct pdc_host_priv *hpriv = ap->host_set->private_data; |
459 | void __iomem *dimm_mmio = hpriv->dimm_mmio; | 459 | void __iomem *dimm_mmio = hpriv->dimm_mmio; |
460 | unsigned int portno = ap->port_no; | 460 | unsigned int portno = ap->port_no; |
461 | unsigned int i, last, idx, total_len = 0, sgt_len; | 461 | unsigned int i, idx, total_len = 0, sgt_len; |
462 | u32 *buf = (u32 *) &pp->dimm_buf[PDC_DIMM_HEADER_SZ]; | 462 | u32 *buf = (u32 *) &pp->dimm_buf[PDC_DIMM_HEADER_SZ]; |
463 | 463 | ||
464 | assert(qc->flags & ATA_QCFLAG_DMAMAP); | 464 | assert(qc->flags & ATA_QCFLAG_DMAMAP); |
@@ -471,12 +471,11 @@ static void pdc20621_dma_prep(struct ata_queued_cmd *qc) | |||
471 | /* | 471 | /* |
472 | * Build S/G table | 472 | * Build S/G table |
473 | */ | 473 | */ |
474 | last = qc->n_elem; | ||
475 | idx = 0; | 474 | idx = 0; |
476 | for (i = 0; i < last; i++) { | 475 | ata_for_each_sg(sg, qc) { |
477 | buf[idx++] = cpu_to_le32(sg_dma_address(&sg[i])); | 476 | buf[idx++] = cpu_to_le32(sg_dma_address(sg)); |
478 | buf[idx++] = cpu_to_le32(sg_dma_len(&sg[i])); | 477 | buf[idx++] = cpu_to_le32(sg_dma_len(sg)); |
479 | total_len += sg_dma_len(&sg[i]); | 478 | total_len += sg_dma_len(sg); |
480 | } | 479 | } |
481 | buf[idx - 1] |= cpu_to_le32(ATA_PRD_EOT); | 480 | buf[idx - 1] |= cpu_to_le32(ATA_PRD_EOT); |
482 | sgt_len = idx * 4; | 481 | sgt_len = idx * 4; |