summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAlbert Lee <albertcc@tw.ibm.com>2006-05-18 17:51:10 +0800
committerJeff Garzik <jeff@garzik.org>2006-05-20 00:37:01 -0400
commiteec4c3f317991dc85c786ffccd9c1a8620c41b18 (patch)
tree0ba309ca3e7df22295c43181715f7b0c445a92b1 /drivers
parent3655d1d323386e001c786af10f0a3f39f438f03b (diff)
downloadlinux-3.10-eec4c3f317991dc85c786ffccd9c1a8620c41b18.tar.gz
linux-3.10-eec4c3f317991dc85c786ffccd9c1a8620c41b18.tar.bz2
linux-3.10-eec4c3f317991dc85c786ffccd9c1a8620c41b18.zip
[PATCH] libata: use qc->result_tf for temp taskfile storage
Use qc->result_tf for temp taskfile storage. Signed-off-by: Albert Lee <albertcc@tw.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/libata-core.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index aa38ed3e59a..bf00d2b2e40 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -3865,10 +3865,16 @@ static void atapi_pio_bytes(struct ata_queued_cmd *qc)
unsigned int ireason, bc_lo, bc_hi, bytes;
int i_write, do_write = (qc->tf.flags & ATA_TFLAG_WRITE) ? 1 : 0;
- ap->ops->tf_read(ap, &qc->tf);
- ireason = qc->tf.nsect;
- bc_lo = qc->tf.lbam;
- bc_hi = qc->tf.lbah;
+ /* Abuse qc->result_tf for temp storage of intermediate TF
+ * here to save some kernel stack usage.
+ * For normal completion, qc->result_tf is not relevant. For
+ * error, qc->result_tf is later overwritten by ata_qc_complete().
+ * So, the correctness of qc->result_tf is not affected.
+ */
+ ap->ops->tf_read(ap, &qc->result_tf);
+ ireason = qc->result_tf.nsect;
+ bc_lo = qc->result_tf.lbam;
+ bc_hi = qc->result_tf.lbah;
bytes = (bc_hi << 8) | bc_lo;
/* shall be cleared to zero, indicating xfer of data */