From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Viresh Kumar <viresh.linux@gmail.com>,
Vinod Koul <vinod.koul@intel.com>,
linux-kernel@vger.kernel.org, spear-devel@list.st.com
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH 5/6] dma: dw: return DMA_SUCCESS immediately from device_tx_status()
Date: Mon, 15 Jul 2013 15:04:40 +0300 [thread overview]
Message-ID: <1373889881-21075-5-git-send-email-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <1373889881-21075-1-git-send-email-andriy.shevchenko@linux.intel.com>
There is no point to go throught the rest of the function if first call to
dma_cookie_status() returned DMA_SUCCESS.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/dma/dw/core.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c
index f70c6b4..22fc7b3 100644
--- a/drivers/dma/dw/core.c
+++ b/drivers/dma/dw/core.c
@@ -1098,12 +1098,12 @@ dwc_tx_status(struct dma_chan *chan,
enum dma_status ret;
ret = dma_cookie_status(chan, cookie, txstate);
- if (ret != DMA_SUCCESS) {
- dwc_scan_descriptors(to_dw_dma(chan->device), dwc);
+ if (ret == DMA_SUCCESS)
+ return ret;
- ret = dma_cookie_status(chan, cookie, txstate);
- }
+ dwc_scan_descriptors(to_dw_dma(chan->device), dwc);
+ ret = dma_cookie_status(chan, cookie, txstate);
if (ret != DMA_SUCCESS)
dma_set_residue(txstate, dwc_get_residue(dwc));
--
1.8.3.2
next prev parent reply other threads:[~2013-07-15 12:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-15 12:04 [PATCH 1/6] acpi-dma: fix sparse warning Andy Shevchenko
2013-07-15 12:04 ` [PATCH 2/6] dma: dw: append MODULE_DEVICE_TABLE for ACPI case Andy Shevchenko
2013-07-15 12:04 ` [PATCH 3/6] dma: dw: improve comparison with ~0 Andy Shevchenko
2013-07-15 12:04 ` [PATCH 4/6] dma: dw: allow shared interrupts Andy Shevchenko
2013-07-15 12:04 ` Andy Shevchenko [this message]
2013-07-15 12:04 ` [PATCH 6/6] dma: dw: return DMA_PAUSED only if cookie status is DMA_IN_PROGRESS Andy Shevchenko
2013-07-16 10:18 ` [PATCH 1/6] acpi-dma: fix sparse warning Viresh Kumar
2013-07-22 9:15 ` Vinod Koul
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=1373889881-21075-5-git-send-email-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=spear-devel@list.st.com \
--cc=vinod.koul@intel.com \
--cc=viresh.linux@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome