From: Andy Shevchenko Date: Tue, 19 Jun 2012 10:34:04 +0000 (+0300) Subject: dw_dmac: print correct number of scanned descriptors X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2ab3727634bf88583b40541ea32df6dadfb8cc6c;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git dw_dmac: print correct number of scanned descriptors In case the first descriptor we found is available, the counter still remains 0 value which is wrong. This patch fixes the counter behaviour. Signed-off-by: Andy Shevchenko Acked-by: Viresh Kumar Signed-off-by: Vinod Koul --- diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c index 467599a4b9b6..a37608d02a2c 100644 --- a/drivers/dma/dw_dmac.c +++ b/drivers/dma/dw_dmac.c @@ -105,13 +105,13 @@ static struct dw_desc *dwc_desc_get(struct dw_dma_chan *dwc) spin_lock_irqsave(&dwc->lock, flags); list_for_each_entry_safe(desc, _desc, &dwc->free_list, desc_node) { + i++; if (async_tx_test_ack(&desc->txd)) { list_del(&desc->desc_node); ret = desc; break; } dev_dbg(chan2dev(&dwc->chan), "desc %p not ACKed\n", desc); - i++; } spin_unlock_irqrestore(&dwc->lock, flags);