From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 405F27E1F for ; Fri, 5 Dec 2014 16:57:16 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 05 Dec 2014 07:57:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,691,1406617200"; d="scan'208";a="494282090" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga003.jf.intel.com with ESMTP; 05 Dec 2014 07:53:48 -0800 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id sB5FvDTi029520; Fri, 5 Dec 2014 15:57:13 GMT Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id sB5FvD3W023576; Fri, 5 Dec 2014 15:57:13 GMT Received: (from bricha3@localhost) by sivswdev01.ir.intel.com with id sB5FvDrp023572; Fri, 5 Dec 2014 15:57:13 GMT From: Bruce Richardson To: dev@dpdk.org, ssujith@cisco.com Date: Fri, 5 Dec 2014 15:57:12 +0000 Message-Id: <1417795032-23524-3-git-send-email-bruce.richardson@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1417795032-23524-1-git-send-email-bruce.richardson@intel.com> References: <1417795032-23524-1-git-send-email-bruce.richardson@intel.com> Subject: [dpdk-dev] [PATCH 2/2] enic: fix error with uninitialized variable. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 15:57:16 -0000 The variable notify_pa is only initialized inside one branch of an if statement, triggering a compiler error with clang 3.3 on FreeBSD. CC vnic/vnic_dev.o /usr/home/bruce/dpdk.org/lib/librte_pmd_enic/vnic/vnic_dev.c:777:6: fatal error: variable 'notify_pa' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (!vnic_dev_in_reset(vdev)) { Fix this issue by adding "= 0" to the variable definition. Signed-off-by: Bruce Richardson --- lib/librte_pmd_enic/vnic/vnic_dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_pmd_enic/vnic/vnic_dev.c b/lib/librte_pmd_enic/vnic/vnic_dev.c index 21d5521..b1cd63f 100644 --- a/lib/librte_pmd_enic/vnic/vnic_dev.c +++ b/lib/librte_pmd_enic/vnic/vnic_dev.c @@ -764,7 +764,7 @@ int vnic_dev_notify_setcmd(struct vnic_dev *vdev, int vnic_dev_notify_set(struct vnic_dev *vdev, u16 intr) { void *notify_addr = NULL; - dma_addr_t notify_pa; + dma_addr_t notify_pa = 0; char name[NAME_MAX]; static u32 instance; -- 2.1.0