diff mbox

Build warning in drivers/dma/mmp_tdma.c

Message ID 20131129053118.GC8834@intel.com (mailing list archive)
State Accepted
Commit a9ebbcd986de
Headers show

Commit Message

Vinod Koul Nov. 29, 2013, 5:31 a.m. UTC
On Thu, Nov 28, 2013 at 02:58:53PM -0800, Dan Williams wrote:
> My build warning test is failing on this driver please fix:
> 
> drivers/dma/mmp_tdma.c:236:8: warning: 'tdcr' may be used
> uninitialized in this function [-Wuninitialized]
> 
> It's valid as mmp_tdma_control as the direction is specified in
> mmp_tdma_control() and may not be one of the two tests in that branch.
Yup, i guess best would be init to zero, which is what i have done here
I did check this driver and got bunch of warns which i fixed in [1]. But i didnt
get this one, i need to redo my build scripts now or use yours :)

From: Vinod Koul <vinod.koul@intel.com>
Date: Fri, 29 Nov 2013 10:52:52 +0530
Subject: [PATCH] dmaengine: mmp: fix uninitialized variable

drivers/dma/mmp_tdma.c:236:8: warning: 'tdcr' may be used
uninitialized in this function [-Wuninitialized]

Reported-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
 drivers/dma/mmp_tdma.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/drivers/dma/mmp_tdma.c b/drivers/dma/mmp_tdma.c
index 61b562b..d4b730c 100644
--- a/drivers/dma/mmp_tdma.c
+++ b/drivers/dma/mmp_tdma.c
@@ -182,7 +182,7 @@  static void mmp_tdma_pause_chan(struct mmp_tdma_chan *tdmac)
 
 static int mmp_tdma_config_chan(struct mmp_tdma_chan *tdmac)
 {
-	unsigned int tdcr;
+	unsigned int tdcr = 0;
 
 	mmp_tdma_disable_chan(tdmac);