]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
dmaengine: vdma: Fix compilation warning in cyclic dma mode
authorKedareswara rao Appana <appana.durga.rao@xilinx.com>
Wed, 13 Jul 2016 09:20:23 +0000 (14:50 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 14 Jul 2016 06:13:05 +0000 (08:13 +0200)
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 <appanad@xilinx.com>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/xilinx/xilinx_vdma.c

index 0f5b38a0e46f4f5e7e18fe34eabe289f4b87fdca..0af0cf4b5f2e4349f6d17e3c77c2300f0a2159eb 100644 (file)
@@ -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);