Skip to content

Commit

Permalink
dmaengine: ste_dma40: fix implicit conversion
Browse files Browse the repository at this point in the history
The function d40_prep_sg takes the type enum dma_transfer_direction
as second last parameter. However, the memcpy calls pass DMA_NONE
which is of type enum dma_data_direction. Fix this by passing the
actual transfer direction DMA_MEM_TO_MEM.

This does not change the actual code flow since only the transfer
direction DMA_MEM_TO_DEV and DMA_DEV_TO_MEM are actually used in the
function d40_prep_sg.

Signed-off-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
  • Loading branch information
Stefan Agner authored and Vinod Koul committed Apr 1, 2015
1 parent 8adc53f commit de6b641
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/dma/ste_dma40.c
Original file line number Diff line number Diff line change
Expand Up @@ -2514,7 +2514,8 @@ static struct dma_async_tx_descriptor *d40_prep_memcpy(struct dma_chan *chan,
sg_dma_len(&dst_sg) = size;
sg_dma_len(&src_sg) = size;

return d40_prep_sg(chan, &src_sg, &dst_sg, 1, DMA_NONE, dma_flags);
return d40_prep_sg(chan, &src_sg, &dst_sg, 1,
DMA_MEM_TO_MEM, dma_flags);
}

static struct dma_async_tx_descriptor *
Expand All @@ -2526,7 +2527,8 @@ d40_prep_memcpy_sg(struct dma_chan *chan,
if (dst_nents != src_nents)
return NULL;

return d40_prep_sg(chan, src_sg, dst_sg, src_nents, DMA_NONE, dma_flags);
return d40_prep_sg(chan, src_sg, dst_sg, src_nents,
DMA_MEM_TO_MEM, dma_flags);
}

static struct dma_async_tx_descriptor *
Expand Down

0 comments on commit de6b641

Please sign in to comment.