aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/sata_mv.c
diff options
context:
space:
mode:
authorMark Lord <liml@rtr.ca>2009-04-13 11:27:18 -0400
committerJeff Garzik <jgarzik@redhat.com>2009-04-17 19:04:24 -0400
commit8d2b450d0f9233f221d545f26720eebbc468e857 (patch)
tree2058611a0250cbc740eeedaf989a0f6a74cac29b /drivers/ata/sata_mv.c
parent20d9207849d5abe60461841b3c3724f6e7c9d33e (diff)
sata_mv: tidy up qc->tf usage in qc_prep() functions
Tidy up qc->tf accesses in the mv_qc_prep() functions. Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/sata_mv.c')
-rw-r--r--drivers/ata/sata_mv.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index 37ae5dc1070c..c7da6022c6b4 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -1898,17 +1898,17 @@ static void mv_qc_prep(struct ata_queued_cmd *qc)
1898 struct ata_port *ap = qc->ap; 1898 struct ata_port *ap = qc->ap;
1899 struct mv_port_priv *pp = ap->private_data; 1899 struct mv_port_priv *pp = ap->private_data;
1900 __le16 *cw; 1900 __le16 *cw;
1901 struct ata_taskfile *tf; 1901 struct ata_taskfile *tf = &qc->tf;
1902 u16 flags = 0; 1902 u16 flags = 0;
1903 unsigned in_index; 1903 unsigned in_index;
1904 1904
1905 if ((qc->tf.protocol != ATA_PROT_DMA) && 1905 if ((tf->protocol != ATA_PROT_DMA) &&
1906 (qc->tf.protocol != ATA_PROT_NCQ)) 1906 (tf->protocol != ATA_PROT_NCQ))
1907 return; 1907 return;
1908 1908
1909 /* Fill in command request block 1909 /* Fill in command request block
1910 */ 1910 */
1911 if (!(qc->tf.flags & ATA_TFLAG_WRITE)) 1911 if (!(tf->flags & ATA_TFLAG_WRITE))
1912 flags |= CRQB_FLAG_READ; 1912 flags |= CRQB_FLAG_READ;
1913 WARN_ON(MV_MAX_Q_DEPTH <= qc->tag); 1913 WARN_ON(MV_MAX_Q_DEPTH <= qc->tag);
1914 flags |= qc->tag << CRQB_TAG_SHIFT; 1914 flags |= qc->tag << CRQB_TAG_SHIFT;
@@ -1924,7 +1924,6 @@ static void mv_qc_prep(struct ata_queued_cmd *qc)
1924 pp->crqb[in_index].ctrl_flags = cpu_to_le16(flags); 1924 pp->crqb[in_index].ctrl_flags = cpu_to_le16(flags);
1925 1925
1926 cw = &pp->crqb[in_index].ata_cmd[0]; 1926 cw = &pp->crqb[in_index].ata_cmd[0];
1927 tf = &qc->tf;
1928 1927
1929 /* Sadly, the CRQB cannot accomodate all registers--there are 1928 /* Sadly, the CRQB cannot accomodate all registers--there are
1930 * only 11 bytes...so we must pick and choose required 1929 * only 11 bytes...so we must pick and choose required
@@ -1990,16 +1989,16 @@ static void mv_qc_prep_iie(struct ata_queued_cmd *qc)
1990 struct ata_port *ap = qc->ap; 1989 struct ata_port *ap = qc->ap;
1991 struct mv_port_priv *pp = ap->private_data; 1990 struct mv_port_priv *pp = ap->private_data;
1992 struct mv_crqb_iie *crqb; 1991 struct mv_crqb_iie *crqb;
1993 struct ata_taskfile *tf; 1992 struct ata_taskfile *tf = &qc->tf;
1994 unsigned in_index; 1993 unsigned in_index;
1995 u32 flags = 0; 1994 u32 flags = 0;
1996 1995
1997 if ((qc->tf.protocol != ATA_PROT_DMA) && 1996 if ((tf->protocol != ATA_PROT_DMA) &&
1998 (qc->tf.protocol != ATA_PROT_NCQ)) 1997 (tf->protocol != ATA_PROT_NCQ))
1999 return; 1998 return;
2000 1999
2001 /* Fill in Gen IIE command request block */ 2000 /* Fill in Gen IIE command request block */
2002 if (!(qc->tf.flags & ATA_TFLAG_WRITE)) 2001 if (!(tf->flags & ATA_TFLAG_WRITE))
2003 flags |= CRQB_FLAG_READ; 2002 flags |= CRQB_FLAG_READ;
2004 2003
2005 WARN_ON(MV_MAX_Q_DEPTH <= qc->tag); 2004 WARN_ON(MV_MAX_Q_DEPTH <= qc->tag);
@@ -2015,7 +2014,6 @@ static void mv_qc_prep_iie(struct ata_queued_cmd *qc)
2015 crqb->addr_hi = cpu_to_le32((pp->sg_tbl_dma[qc->tag] >> 16) >> 16); 2014 crqb->addr_hi = cpu_to_le32((pp->sg_tbl_dma[qc->tag] >> 16) >> 16);
2016 crqb->flags = cpu_to_le32(flags); 2015 crqb->flags = cpu_to_le32(flags);
2017 2016
2018 tf = &qc->tf;
2019 crqb->ata_cmd[0] = cpu_to_le32( 2017 crqb->ata_cmd[0] = cpu_to_le32(
2020 (tf->command << 16) | 2018 (tf->command << 16) |
2021 (tf->feature << 24) 2019 (tf->feature << 24)