[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20160613170229.GJ16910@localhost>
Date: Mon, 13 Jun 2016 22:32:29 +0530
From: Vinod Koul <vinod.koul@...el.com>
To: Arnd Bergmann <arnd@...db.de>
Cc: Dan Williams <dan.j.williams@...el.com>,
Michal Simek <michal.simek@...inx.com>,
Sören Brinkmann <soren.brinkmann@...inx.com>,
Kedareswara rao Appana <appana.durga.rao@...inx.com>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
dmaengine@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] dma: xilinx-vdma: add some sanity checks
On Mon, Jun 13, 2016 at 05:07:33PM +0200, Arnd Bergmann wrote:
> The newly added xilinx_dma_prep_dma_cyclic function sometimes causes
> a gcc warning about the use of the segment function in case
> we never run into the inner loop of the function:
>
> dma/xilinx/xilinx_vdma.c: In function 'xilinx_dma_prep_dma_cyclic':
> dma/xilinx/xilinx_vdma.c:1808:23: error: 'segment' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> segment->hw.control |= XILINX_DMA_BD_SOP;
>
> This can only happen if the period len is zero (which would cause other
> problems earlier), or if the buffer is shorter than a period. Neither
> of them should ever happen, but by adding an explicit check for these two
> cases, we can abort in a more controlled way, and the compiler is
> able to see that we never use uninitialized data.
Applied after fixing subsystem name
Thanks
--
~Vinod
Powered by blists - more mailing lists