All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pata_arasan_cf: declare/use 'qc' and 'ap' variables in arasan_cf_dma_start()
@ 2012-10-25 17:08 Sergei Shtylyov
  2012-10-26  3:31 ` viresh kumar
  0 siblings, 1 reply; 4+ messages in thread
From: Sergei Shtylyov @ 2012-10-25 17:08 UTC (permalink / raw)
  To: linux-ide, jgarzik, viresh.linux

'acdev->qc' and 'acdev->qc->ap' expressions are used multiple times in this
function, so it makes sense to use the local variables for them.

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

---
The patch is atop of the 'upstream' branch of libata-dev.git...

 drivers/ata/pata_arasan_cf.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Index: libata-dev/drivers/ata/pata_arasan_cf.c
===================================================================
--- libata-dev.orig/drivers/ata/pata_arasan_cf.c
+++ libata-dev/drivers/ata/pata_arasan_cf.c
@@ -668,13 +668,15 @@ 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;
 	u32 xfer_ctr = readl(acdev->vbase + XFER_CTR) & ~XFER_DIR_MASK;
-	u32 write = acdev->qc->tf.flags & ATA_TFLAG_WRITE;
+	u32 write = qc->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, &qc->tf);
 	ata_sff_queue_work(&acdev->work);
 }
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] pata_arasan_cf: declare/use 'qc' and 'ap' variables in arasan_cf_dma_start()
  2012-10-25 17:08 [PATCH] pata_arasan_cf: declare/use 'qc' and 'ap' variables in arasan_cf_dma_start() Sergei Shtylyov
@ 2012-10-26  3:31 ` viresh kumar
  2012-10-26 18:17   ` Sergei Shtylyov
  0 siblings, 1 reply; 4+ messages in thread
From: viresh kumar @ 2012-10-26  3:31 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: linux-ide, jgarzik, spear-devel

On Thu, Oct 25, 2012 at 10:38 PM, Sergei Shtylyov
<sshtylyov@ru.mvista.com> wrote:
> 'acdev->qc' and 'acdev->qc->ap' expressions are used multiple times in this
> function, so it makes sense to use the local variables for them.
>
> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

> ---
> The patch is atop of the 'upstream' branch of libata-dev.git...
>
>  drivers/ata/pata_arasan_cf.c |    6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> Index: libata-dev/drivers/ata/pata_arasan_cf.c
> ===================================================================
> --- libata-dev.orig/drivers/ata/pata_arasan_cf.c
> +++ libata-dev/drivers/ata/pata_arasan_cf.c
> @@ -668,13 +668,15 @@ 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;
>         u32 xfer_ctr = readl(acdev->vbase + XFER_CTR) & ~XFER_DIR_MASK;
> -       u32 write = acdev->qc->tf.flags & ATA_TFLAG_WRITE;
> +       u32 write = qc->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, &qc->tf);
>         ata_sff_queue_work(&acdev->work);
>  }
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] pata_arasan_cf: declare/use 'qc' and 'ap' variables in arasan_cf_dma_start()
  2012-10-26  3:31 ` viresh kumar
@ 2012-10-26 18:17   ` Sergei Shtylyov
  2012-10-26 18:20     ` Viresh Kumar
  0 siblings, 1 reply; 4+ messages in thread
From: Sergei Shtylyov @ 2012-10-26 18:17 UTC (permalink / raw)
  To: viresh kumar; +Cc: Sergei Shtylyov, linux-ide, jgarzik, spear-devel

Hello.

On 10/26/2012 07:31 AM, viresh kumar wrote:

>> 'acdev->qc' and 'acdev->qc->ap' expressions are used multiple times in this
>> function, so it makes sense to use the local variables for them.

>> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

  Another idea came to me afterwards...

>> ---
>> The patch is atop of the 'upstream' branch of libata-dev.git...
>>
>>  drivers/ata/pata_arasan_cf.c |    6 ++++--
>>  1 file changed, 4 insertions(+), 2 deletions(-)

>> Index: libata-dev/drivers/ata/pata_arasan_cf.c
>> ===================================================================
>> --- libata-dev.orig/drivers/ata/pata_arasan_cf.c
>> +++ libata-dev/drivers/ata/pata_arasan_cf.c
>> @@ -668,13 +668,15 @@ 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;
>>         u32 xfer_ctr = readl(acdev->vbase + XFER_CTR) & ~XFER_DIR_MASK;
>> -       u32 write = acdev->qc->tf.flags & ATA_TFLAG_WRITE;
>> +       u32 write = qc->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, &qc->tf);


   Perhaps it was also worth declaring:

	struct ata_taskfile *tf = &qc->tf;

   I'll submit the next version of patch next week, probably...

MBR, Sergei


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] pata_arasan_cf: declare/use 'qc' and 'ap' variables in arasan_cf_dma_start()
  2012-10-26 18:17   ` Sergei Shtylyov
@ 2012-10-26 18:20     ` Viresh Kumar
  0 siblings, 0 replies; 4+ messages in thread
From: Viresh Kumar @ 2012-10-26 18:20 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: Sergei Shtylyov, linux-ide, jgarzik, spear-devel

On 26 October 2012 23:47, Sergei Shtylyov <sshtylyov@mvista.com> wrote:
>    Perhaps it was also worth declaring:
>
>         struct ata_taskfile *tf = &qc->tf;
>
>    I'll submit the next version of patch next week, probably...

Looks fine. Add my acked-by in advance :)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-10-26 18:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-25 17:08 [PATCH] pata_arasan_cf: declare/use 'qc' and 'ap' variables in arasan_cf_dma_start() Sergei Shtylyov
2012-10-26  3:31 ` viresh kumar
2012-10-26 18:17   ` Sergei Shtylyov
2012-10-26 18:20     ` Viresh Kumar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.