From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4AE77A09D9; Wed, 11 Nov 2020 14:14:37 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7068CF90; Wed, 11 Nov 2020 14:14:35 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 272EBF64 for ; Wed, 11 Nov 2020 14:14:32 +0100 (CET) IronPort-SDR: v/GldYwqQL9DkPZwH8nxjrF7edLcSEJBee4unTORsuf2plMwiZa6yNF5ztRso9RrlKhe2a36r4 i6kg3A1hG4tA== X-IronPort-AV: E=McAfee;i="6000,8403,9801"; a="167557788" X-IronPort-AV: E=Sophos;i="5.77,469,1596524400"; d="scan'208";a="167557788" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Nov 2020 05:14:23 -0800 IronPort-SDR: 0OYiz7TqLm7LmsSLH6Mf6GOpWGfcz3o6UMnB9xx9EhS0/7Kvv9f4+IZq/+yz/fGK/NcM6ur4PF h+8leA5eZvVA== X-IronPort-AV: E=Sophos;i="5.77,469,1596524400"; d="scan'208";a="473846047" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.241.123]) ([10.213.241.123]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Nov 2020 05:14:21 -0800 To: Conor Walsh , jiawenwu@trustnetic.com, jianwang@trustnetic.com Cc: dev@dpdk.org, linglix.chen@intel.com References: <20201111130542.1949894-1-conor.walsh@intel.com> From: Ferruh Yigit Message-ID: <455bfd94-bc18-b2c9-947d-c1b9489985f3@intel.com> Date: Wed, 11 Nov 2020 13:14:18 +0000 MIME-Version: 1.0 In-Reply-To: <20201111130542.1949894-1-conor.walsh@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [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" On 11/11/2020 1:05 PM, Conor Walsh wrote: > 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; > This is false positive, right? Is there an actual case that 'offset' is used without initialization? 'txgbe_get_offset_by_id()' return value seems used only to detect fail/success, can you please try with 'txgbe_get_offset_by_id()' returning a simple '-1' on failure, instead of current "-(int)(id + 1)", if it helps with the compiler warning?