public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dmaengine: omap-dma: initialize can_pause to false
@ 2016-10-19 11:05 Colin King
  2016-10-19 13:18 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2016-10-19 11:05 UTC (permalink / raw)
  To: Dan Williams, Vinod Koul, dmaengine; +Cc: linux-kernel

From: Colin Ian King <colin.king@canonical.com>

can_pause is not initialized so it contains garbage.  Fix this
by setting it to false.

Found using static analysis with cppcheck.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/dma/omap-dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/omap-dma.c b/drivers/dma/omap-dma.c
index fd6b9e6..15eb802 100644
--- a/drivers/dma/omap-dma.c
+++ b/drivers/dma/omap-dma.c
@@ -1286,7 +1286,7 @@ static int omap_dma_pause(struct dma_chan *chan)
 	struct omap_dmadev *od = to_omap_dma_dev(chan->device);
 	unsigned long flags;
 	int ret = -EINVAL;
-	bool can_pause;
+	bool can_pause = false;
 
 	spin_lock_irqsave(&od->irq_lock, flags);
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] dmaengine: omap-dma: initialize can_pause to false
  2016-10-19 11:05 [PATCH] dmaengine: omap-dma: initialize can_pause to false Colin King
@ 2016-10-19 13:18 ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2016-10-19 13:18 UTC (permalink / raw)
  To: Colin King; +Cc: Dan Williams, dmaengine, linux-kernel

On Wed, Oct 19, 2016 at 12:05:53PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> can_pause is not initialized so it contains garbage.  Fix this
> by setting it to false.
> 
> Found using static analysis with cppcheck.

It is usuallu helpful to show the warning generated by static tools.

Applied, anyway

-- 
~Vinod

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-10-19 15:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-19 11:05 [PATCH] dmaengine: omap-dma: initialize can_pause to false Colin King
2016-10-19 13:18 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox