From patchwork Fri Nov 29 05:31:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 3256531 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D70E19F1F4 for ; Fri, 29 Nov 2013 06:29:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1C6102064F for ; Fri, 29 Nov 2013 06:29:28 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E42A5205EE for ; Fri, 29 Nov 2013 06:29:26 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VmHZk-00010p-Jf; Fri, 29 Nov 2013 06:29:16 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VmHZi-0008Iq-4F; Fri, 29 Nov 2013 06:29:14 +0000 Received: from mga11.intel.com ([192.55.52.93]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VmHZe-0008IE-5K for linux-arm-kernel@lists.infradead.org; Fri, 29 Nov 2013 06:29:11 +0000 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 28 Nov 2013 22:28:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.93,796,1378882800"; d="scan'208";a="441891566" Received: from vkoul-udesk3.iind.intel.com ([10.223.84.41]) by fmsmga002.fm.intel.com with ESMTP; 28 Nov 2013 22:28:37 -0800 Received: from vkoul-udesk3.iind.intel.com (localhost [127.0.0.1]) by vkoul-udesk3.iind.intel.com (8.14.3/8.14.3/Debian-9.1ubuntu1) with ESMTP id rAT5VRiP018070; Fri, 29 Nov 2013 11:01:27 +0530 Received: (from vkoul@localhost) by vkoul-udesk3.iind.intel.com (8.14.3/8.14.3/Submit) id rAT5VI9o018068; Fri, 29 Nov 2013 11:01:18 +0530 X-Authentication-Warning: vkoul-udesk3.iind.intel.com: vkoul set sender to vinod.koul@intel.com using -f Date: Fri, 29 Nov 2013 11:01:18 +0530 From: Vinod Koul To: Dan Williams Subject: Re: Build warning in drivers/dma/mmp_tdma.c Message-ID: <20131129053118.GC8834@intel.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131129_012910_274040_22B69838 X-CRM114-Status: GOOD ( 28.03 ) X-Spam-Score: -6.9 (------) Cc: Leo Yan , Qiao Zhou , Zhangfei Gao , "dmaengine@vger.kernel.org" , Vinod Koul , "linux-arm-kernel@lists.infradead.org" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 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 Signed-off-by: Vinod Koul --- drivers/dma/mmp_tdma.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 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);