From patchwork Wed Nov 11 13:05:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Conor Walsh X-Patchwork-Id: 84007 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 341C7A09D9; Wed, 11 Nov 2020 14:05:53 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 755D9137D; Wed, 11 Nov 2020 14:05:51 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id A2F89F90 for ; Wed, 11 Nov 2020 14:05:49 +0100 (CET) IronPort-SDR: BDecGT1nwQYa6AjAysvWjHy4rLXD5jS0qHgwZkh57GJP3bGbSzNEaEuXktgel7xNA+kSjHwvAY 3/OlPd7rOLAg== X-IronPort-AV: E=McAfee;i="6000,8403,9801"; a="254850456" X-IronPort-AV: E=Sophos;i="5.77,469,1596524400"; d="scan'208";a="254850456" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Nov 2020 05:05:46 -0800 IronPort-SDR: ywB5WXmUvlfSGHjS4bpzG2f9ZjIlNPamd0oNAHOxVBSy5shEpR6SYyOjbmhx9Bb5bjLofbx6Ut OHsXo4p+DduA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,469,1596524400"; d="scan'208";a="354839365" Received: from silpixa00400466.ir.intel.com ([10.237.213.98]) by orsmga008.jf.intel.com with ESMTP; 11 Nov 2020 05:05:44 -0800 From: Conor Walsh To: jiawenwu@trustnetic.com, jianwang@trustnetic.com Cc: dev@dpdk.org, linglix.chen@intel.com, Conor Walsh Date: Wed, 11 Nov 2020 13:05:42 +0000 Message-Id: <20201111130542.1949894-1-conor.walsh@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v1] net/txgbe: offset needs to be initialised to fix gcc compile error X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When DPDK is compiled with gcc 7.5 with the optimization level set to 1 gcc sees the offset variable in txgbe_ethdev.c as possibly being uninitialised. To correct this error offset has been initialised to 0 in txgbe_ethdev.c Signed-off-by: Conor Walsh --- drivers/net/txgbe/txgbe_ethdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c index 9f533603a1..7fd56c2698 100644 --- a/drivers/net/txgbe/txgbe_ethdev.c +++ b/drivers/net/txgbe/txgbe_ethdev.c @@ -2247,7 +2247,7 @@ txgbe_dev_xstats_get_(struct rte_eth_dev *dev, uint64_t *values, /* Extended stats from txgbe_hw_stats */ for (i = 0; i < limit; i++) { - uint32_t offset; + uint32_t offset = 0; if (txgbe_get_offset_by_id(i, &offset)) { PMD_INIT_LOG(WARNING, "id value %d isn't valid", i); @@ -2270,7 +2270,7 @@ txgbe_dev_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids, return txgbe_dev_xstats_get_(dev, values, limit); for (i = 0; i < limit; i++) { - uint32_t offset; + uint32_t offset = 0; if (txgbe_get_offset_by_id(ids[i], &offset)) { PMD_INIT_LOG(WARNING, "id value %d isn't valid", i);