From: Kedareswara rao Appana Date: Thu, 9 Jun 2016 06:02:12 +0000 (+0530) Subject: dmaengine: vdma: Fix compilation warning in cyclic dma mode X-Git-Tag: v4.8-rc1~117^2~7^2~12 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e167a0b6dc49cb3694fea888560aa462532951dd;p=karo-tx-linux.git dmaengine: vdma: Fix compilation warning in cyclic dma mode This patch fixes the below compilation warining. drivers/dma/xilinx/xilinx_vdma.c: In function 'xilinx_dma_prep_dma_cyclic': drivers/dma/xilinx/xilinx_vdma.c:1808:23: warning: 'segment' may be used uninitialized in this function [-Wmaybe-uninitialized] segment->hw.control |= XILINX_DMA_BD_SOP; The start of packet (SOP) should be set to the first segment in the desc chain not for the last segment of the desc chain. Signed-off-by: Kedareswara rao Appana Reported-by: Stephen Rothwell Signed-off-by: Vinod Koul --- diff --git a/drivers/dma/xilinx/xilinx_vdma.c b/drivers/dma/xilinx/xilinx_vdma.c index 0f5b38a0e46f..0af0cf4b5f2e 100644 --- a/drivers/dma/xilinx/xilinx_vdma.c +++ b/drivers/dma/xilinx/xilinx_vdma.c @@ -1805,7 +1805,7 @@ static struct dma_async_tx_descriptor *xilinx_dma_prep_dma_cyclic( /* For the last DMA_MEM_TO_DEV transfer, set EOP */ if (direction == DMA_MEM_TO_DEV) { - segment->hw.control |= XILINX_DMA_BD_SOP; + head_segment->hw.control |= XILINX_DMA_BD_SOP; segment = list_last_entry(&desc->segments, struct xilinx_axidma_tx_segment, node);