Commit eec4c3f3 authored by Albert Lee's avatar Albert Lee Committed by Jeff Garzik

[PATCH] libata: use qc->result_tf for temp taskfile storage

Use qc->result_tf for temp taskfile storage.
Signed-off-by: default avatarAlbert Lee <albertcc@tw.ibm.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 3655d1d3
...@@ -3865,10 +3865,16 @@ static void atapi_pio_bytes(struct ata_queued_cmd *qc) ...@@ -3865,10 +3865,16 @@ static void atapi_pio_bytes(struct ata_queued_cmd *qc)
unsigned int ireason, bc_lo, bc_hi, bytes; unsigned int ireason, bc_lo, bc_hi, bytes;
int i_write, do_write = (qc->tf.flags & ATA_TFLAG_WRITE) ? 1 : 0; int i_write, do_write = (qc->tf.flags & ATA_TFLAG_WRITE) ? 1 : 0;
ap->ops->tf_read(ap, &qc->tf); /* Abuse qc->result_tf for temp storage of intermediate TF
ireason = qc->tf.nsect; * here to save some kernel stack usage.
bc_lo = qc->tf.lbam; * For normal completion, qc->result_tf is not relevant. For
bc_hi = qc->tf.lbah; * 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; bytes = (bc_hi << 8) | bc_lo;
/* shall be cleared to zero, indicating xfer of data */ /* shall be cleared to zero, indicating xfer of data */
......
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