summaryrefslogtreecommitdiff
path: root/drivers/dma/idma64.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2015-11-17 13:37:10 +0200
committerVinod Koul <vinod.koul@intel.com>2015-12-05 13:54:28 +0530
commit390c49f7174a85d88ec080058d8b5c2e301d3f6b (patch)
treea44a74f1ed1659a72ce04a3ed3ffcaf547af1faf /drivers/dma/idma64.c
parentac02979413e0310f85bbcc2945d65da7071c08fe (diff)
dmaengine: idma64: use local variable to index descriptor
Since a local variable contains the number of hardware desriptors at the beginning of idma64_desc_fill() we may use it to index the last descriptor as well. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/idma64.c')
-rw-r--r--drivers/dma/idma64.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/dma/idma64.c b/drivers/dma/idma64.c
index b6c13f9fffb6..3cb7b2c78197 100644
--- a/drivers/dma/idma64.c
+++ b/drivers/dma/idma64.c
@@ -274,10 +274,10 @@ static void idma64_desc_fill(struct idma64_chan *idma64c,
struct idma64_desc *desc)
{
struct dma_slave_config *config = &idma64c->config;
- struct idma64_hw_desc *hw = &desc->hw[desc->ndesc - 1];
+ unsigned int i = desc->ndesc;
+ struct idma64_hw_desc *hw = &desc->hw[i - 1];
struct idma64_lli *lli = hw->lli;
u64 llp = 0;
- unsigned int i = desc->ndesc;
/* Fill the hardware descriptors and link them to a list */
do {
@@ -287,7 +287,7 @@ static void idma64_desc_fill(struct idma64_chan *idma64c,
desc->length += hw->len;
} while (i);
- /* Trigger interrupt after last block */
+ /* Trigger an interrupt after the last block is transfered */
lli->ctllo |= IDMA64C_CTLL_INT_EN;
}