All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@mvista.com>
To: viresh kumar <viresh.kumar@linaro.org>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>,
	linux-ide@vger.kernel.org, jgarzik@pobox.com,
	spear-devel <spear-devel@list.st.com>
Subject: Re: [PATCH] pata_arasan_cf: declare/use 'qc' and 'ap' variables in arasan_cf_dma_start()
Date: Fri, 26 Oct 2012 22:17:58 +0400	[thread overview]
Message-ID: <508AD3D6.6080502@mvista.com> (raw)
In-Reply-To: <CAOh2x==5iy4cDvney8uue2V10Ok1m+v5zeRJjqsw4Tk16reMaQ@mail.gmail.com>

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


  reply	other threads:[~2012-10-26 18:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2012-10-26 18:20     ` Viresh Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=508AD3D6.6080502@mvista.com \
    --to=sshtylyov@mvista.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=spear-devel@list.st.com \
    --cc=sshtylyov@ru.mvista.com \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.