pata_arasan_cf: declare/use more local variables in arasan_cf_dma_start()
Subsystems (2)
PATCH v2 1/1 pata_arasan_cf: declare/use more local variables in arasan_cf_dma_start()
'acdev->qc', 'acdev->qc->ap', and 'acdev->qc->tf' expressions are used multiple times in this function, so it makes sense to use the local variables for them.
---
The patch is atop of the 'upstream' branch of libata-dev.git...
drivers/ata/pata_arasan_cf.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/ata/pata_arasan_cf.c +5 -2
@@ -668,13 +668,16 @@ void arasan_cf_error_handler(struct ata_static void arasan_cf_dma_start (struct arasan_cf_dev *acdev) { +struct ata_queued_cmd *qc = acdev->qc; +struct ata_port *ap = qc->ap; +struct ata_taskfile *tf = &qc->tf;u32 xfer_ctr =readl (acdev->vbase +XFER_CTR ) & ~XFER_DIR_MASK ; -u32 write = acdev->qc->tf.flags &ATA_TFLAG_WRITE ; +u32 write = tf->flags &ATA_TFLAG_WRITE ; xfer_ctr |= write ?XFER_WRITE :XFER_READ ;writel (xfer_ctr, acdev->vbase +XFER_CTR ); - acdev->qc->ap->ops->sff_exec_command (acdev->qc->ap, &acdev->qc->tf); + ap->ops->sff_exec_command (ap, tf);ata_sff_queue_work (&acdev->work); }
Quoted 23 lines · Sergei Shtylyov
'
acdev->qc', 'acdev->qc->ap', and 'acdev->qc->tf' expressions are used multiple times in this function, so it makes sense to use the local variables for them.Signed-off-by Sergei Shtylyov <[email protected]>Acked-by Viresh Kumar <[email protected]>---
The patch is atop of the 'upstream' branch of libata-dev.git...drivers/ata/pata_arasan_cf.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)Index:
libata-dev/drivers/ata/pata_arasan_cf.c
===================================================================drivers/ata/pata_arasan_cf.c +3
-0@@ -668,13 +668,16 @@ void arasan_cf_error_handler(struct ata_static void arasan_cf_dma_start (struct arasan_cf_dev *acdev) { +struct ata_queued_cmd *qc = acdev->qc; +struct ata_port *ap = qc->ap; +struct ata_taskfile *tf = &qc->tf;
drivers/ata/pata_arasan_cf.c void arasan_cf_error_handler(struct ata_ · line 681
Quoted 10 lines
drivers/ata/pata_arasan_cf.c +2
-2u32 xfer_ctr =readl (acdev->vbase +XFER_CTR ) & ~XFER_DIR_MASK ; -u32 write = acdev->qc->tf.flags &ATA_TFLAG_WRITE ; +u32 write = tf->flags &ATA_TFLAG_WRITE ; xfer_ctr |= write ?XFER_WRITE :XFER_READ ;writel (xfer_ctr, acdev->vbase +XFER_CTR ); - acdev->qc->ap->ops->sff_exec_command (acdev->qc->ap, &acdev->qc->tf); + ap->ops->sff_exec_command (ap, tf);ata_sff_queue_work (&acdev->work);
Looks fine. Thanks.
Jeff Garzik
AppliedQuoted 11 lines · Sergei Shtylyov
'
acdev->qc', 'acdev->qc->ap', and 'acdev->qc->tf' expressions are used multiple times in this function, so it makes sense to use the local variables for them.Signed-off-by Sergei Shtylyov <[email protected]>Acked-by Viresh Kumar <[email protected]>---
The patch is atop of the 'upstream' branch of libata-dev.git...drivers/ata/pata_arasan_cf.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
applied