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: 3256521 Return-Path: X-Original-To: patchwork-dmaengine@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 1CEE19F1F4 for ; Fri, 29 Nov 2013 06:28:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4C65C2064F for ; Fri, 29 Nov 2013 06:28:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4F3D0205EE for ; Fri, 29 Nov 2013 06:28:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751054Ab3K2G2l (ORCPT ); Fri, 29 Nov 2013 01:28:41 -0500 Received: from mga11.intel.com ([192.55.52.93]:32290 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750871Ab3K2G2k (ORCPT ); Fri, 29 Nov 2013 01:28:40 -0500 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 Cc: Zhangfei Gao , Qiao Zhou , Leo Yan , "dmaengine@vger.kernel.org" , Vinod Koul , "linux-arm-kernel@lists.infradead.org" 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) Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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);