From patchwork Wed Nov 11 15:39:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Conor Walsh X-Patchwork-Id: 84023 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 6A919A09D9; Wed, 11 Nov 2020 16:39:43 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2C4C7F90; Wed, 11 Nov 2020 16:39:41 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 3C6D7F64 for ; Wed, 11 Nov 2020 16:39:37 +0100 (CET) IronPort-SDR: QkPT9mVohbKOvUcoHLX7EYP/Q39UgONS9GxIryq6ttfos80j8j80yBbtCTmYp1DLfWIZ7Cb8f4 YRKkUejwqwYg== X-IronPort-AV: E=McAfee;i="6000,8403,9801"; a="167579655" X-IronPort-AV: E=Sophos;i="5.77,469,1596524400"; d="scan'208";a="167579655" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Nov 2020 07:39:36 -0800 IronPort-SDR: pizoxI1tCwX4U8cuffDuhTTdxhhLuKiR3TZZfRAbEmYO5Z+cQM0rJYv6nqwb58UaFZnk0sSpzf Yhtqo1bh/p1A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,469,1596524400"; d="scan'208";a="530248340" Received: from silpixa00400466.ir.intel.com ([10.237.213.98]) by fmsmga006.fm.intel.com with ESMTP; 11 Nov 2020 07:39:35 -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 15:39:33 +0000 Message-Id: <20201111153933.1951384-1-conor.walsh@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201111130542.1949894-1-conor.walsh@intel.com> References: <20201111130542.1949894-1-conor.walsh@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2] net/txgbe: return changed 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 the final return statement in txgbe_get_offset_by_id was simplified to return -1. Signed-off-by: Conor Walsh Reviewed-by: Ferruh Yigit --- drivers/net/txgbe/txgbe_ethdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c index 9f533603a1..f8dffe1f12 100644 --- a/drivers/net/txgbe/txgbe_ethdev.c +++ b/drivers/net/txgbe/txgbe_ethdev.c @@ -2140,9 +2140,8 @@ txgbe_get_offset_by_id(uint32_t id, uint32_t *offset) nb * (TXGBE_NB_QP_STATS * sizeof(uint64_t)); return 0; } - id -= TXGBE_NB_QP_STATS * TXGBE_MAX_QP; - return -(int)(id + 1); + return -1; } static int txgbe_dev_xstats_get_names(struct rte_eth_dev *dev,