summaryrefslogtreecommitdiffstats
path: root/drivers/ata/pdc_adma.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-19 00:08:35 +0200
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-19 00:08:35 +0200
commit2af170dd241810212cbdbdc802ba7d39e3fb23b9 (patch)
tree3d16719aa102444337f161c457502704a4967a53 /drivers/ata/pdc_adma.c
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog (diff)
parent[libata] kill ata_sg_is_last() (diff)
downloadlinux-2af170dd241810212cbdbdc802ba7d39e3fb23b9.tar.xz
linux-2af170dd241810212cbdbdc802ba7d39e3fb23b9.zip
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev: [libata] kill ata_sg_is_last() Update libata driver for bf548 atapi controller against the 2.6.24 tree. libata-sff: Correct use of check_status() drivers/ata: add support to Freescale 3.0Gbps SATA Controller pata_acpi: fix build breakage if !CONFIG_PM
Diffstat (limited to 'drivers/ata/pdc_adma.c')
-rw-r--r--drivers/ata/pdc_adma.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/ata/pdc_adma.c b/drivers/ata/pdc_adma.c
index 8d1b03d5bcb1..199f7e150eb3 100644
--- a/drivers/ata/pdc_adma.c
+++ b/drivers/ata/pdc_adma.c
@@ -318,7 +318,7 @@ static int adma_fill_sg(struct ata_queued_cmd *qc)
struct scatterlist *sg;
struct ata_port *ap = qc->ap;
struct adma_port_priv *pp = ap->private_data;
- u8 *buf = pp->pkt;
+ u8 *buf = pp->pkt, *last_buf = NULL;
int i = (2 + buf[3]) * 8;
u8 pFLAGS = pORD | ((qc->tf.flags & ATA_TFLAG_WRITE) ? pDIRO : 0);
@@ -334,8 +334,7 @@ static int adma_fill_sg(struct ata_queued_cmd *qc)
*(__le32 *)(buf + i) = cpu_to_le32(len);
i += 4;
- if (ata_sg_is_last(sg, qc))
- pFLAGS |= pEND;
+ last_buf = &buf[i];
buf[i++] = pFLAGS;
buf[i++] = qc->dev->dma_mode & 0xf;
buf[i++] = 0; /* pPKLW */
@@ -348,6 +347,10 @@ static int adma_fill_sg(struct ata_queued_cmd *qc)
VPRINTK("PRD[%u] = (0x%lX, 0x%X)\n", i/4,
(unsigned long)addr, len);
}
+
+ if (likely(last_buf))
+ *last_buf |= pEND;
+
return i;
}