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 DA4FB8079 for ; Tue, 9 Dec 2014 09:56:21 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 09 Dec 2014 00:56:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,543,1413270000"; d="scan'208";a="650802584" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga002.jf.intel.com with ESMTP; 09 Dec 2014 00:56:20 -0800 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id sB98uEtX031563; Tue, 9 Dec 2014 16:56:14 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id sB98uCac032000; Tue, 9 Dec 2014 16:56:14 +0800 Received: (from hzhan75@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id sB98uB7Q031996; Tue, 9 Dec 2014 16:56:11 +0800 From: Helin Zhang To: dev@dpdk.org Date: Tue, 9 Dec 2014 16:56:10 +0800 Message-Id: <1418115370-31965-1-git-send-email-helin.zhang@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] enic: fix of compile error 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: Tue, 09 Dec 2014 08:56:22 -0000 Compile warnings/errors was found on gcc 4.7.2 as follows. Variables was reported of being used but uninitialized. Assigning an initial value to it is needed. lib/librte_pmd_enic/vnic/vnic_dev.c: In function vnic_dev_get_mac_addr: lib/librte_pmd_enic/vnic/vnic_dev.c:393:16: error: a1 may be used uninitialized in this function [-Werror=uninitialized] lib/librte_pmd_enic/vnic/vnic_dev.c:629:10: note: a1 was declared here lib/librte_pmd_enic/vnic/vnic_dev.c: In function vnic_dev_set_mac_addr: lib/librte_pmd_enic/vnic/vnic_dev.c:393:16: error: a1 may be used uninitialized in this function [-Werror=uninitialized] lib/librte_pmd_enic/vnic/vnic_dev.c:980:10: note: a1 was declared here Signed-off-by: Helin Zhang --- lib/librte_pmd_enic/vnic/vnic_dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_pmd_enic/vnic/vnic_dev.c b/lib/librte_pmd_enic/vnic/vnic_dev.c index b1cd63f..6407994 100644 --- a/lib/librte_pmd_enic/vnic/vnic_dev.c +++ b/lib/librte_pmd_enic/vnic/vnic_dev.c @@ -626,7 +626,7 @@ int vnic_dev_soft_reset_done(struct vnic_dev *vdev, int *done) int vnic_dev_get_mac_addr(struct vnic_dev *vdev, u8 *mac_addr) { - u64 a0, a1; + u64 a0, a1 = 0; int wait = 1000; int err, i; @@ -977,7 +977,7 @@ struct rte_pci_device *vnic_dev_get_pdev(struct vnic_dev *vdev) int vnic_dev_set_mac_addr(struct vnic_dev *vdev, u8 *mac_addr) { - u64 a0, a1; + u64 a0, a1 = 0; int wait = 1000; int i; -- 1.8.1.4