aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2015-11-17 06:37:10 -0500
committerVinod Koul <vinod.koul@intel.com>2015-12-05 03:24:28 -0500
commit390c49f7174a85d88ec080058d8b5c2e301d3f6b (patch)
treea44a74f1ed1659a72ce04a3ed3ffcaf547af1faf
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>
-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,
274 struct idma64_desc *desc) 274 struct idma64_desc *desc)
275{ 275{
276 struct dma_slave_config *config = &idma64c->config; 276 struct dma_slave_config *config = &idma64c->config;
277 struct idma64_hw_desc *hw = &desc->hw[desc->ndesc - 1]; 277 unsigned int i = desc->ndesc;
278 struct idma64_hw_desc *hw = &desc->hw[i - 1];
278 struct idma64_lli *lli = hw->lli; 279 struct idma64_lli *lli = hw->lli;
279 u64 llp = 0; 280 u64 llp = 0;
280 unsigned int i = desc->ndesc;
281 281
282 /* Fill the hardware descriptors and link them to a list */ 282 /* Fill the hardware descriptors and link them to a list */
283 do { 283 do {
@@ -287,7 +287,7 @@ static void idma64_desc_fill(struct idma64_chan *idma64c,
287 desc->length += hw->len; 287 desc->length += hw->len;
288 } while (i); 288 } while (i);
289 289
290 /* Trigger interrupt after last block */ 290 /* Trigger an interrupt after the last block is transfered */
291 lli->ctllo |= IDMA64C_CTLL_INT_EN; 291 lli->ctllo |= IDMA64C_CTLL_INT_EN;
292} 292}
293 293