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 5F0C5A0350; Fri, 8 May 2020 18:46:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D30C31DAB3; Fri, 8 May 2020 18:46:02 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 4C16B1DAB2 for ; Fri, 8 May 2020 18:46:01 +0200 (CEST) IronPort-SDR: vPPvmA6b9TNWP5Jki+SSbYHLdbUf+B+yLMz0wuAmJM6m+H6o8V1p6Mm3MCJbEwfZy1Oou5e5P4 FzFYim23q0gQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 May 2020 09:46:00 -0700 IronPort-SDR: 8r3rA3NG89Dj9J4gKRLR1gosHYXjZHZEHjeaYrKZFyjQINU+/seAY5bZSMU4IR79OZcI6qJ/SG QTQoQvkEJlfg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,368,1583222400"; d="scan'208";a="462637775" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.180]) by fmsmga006.fm.intel.com with ESMTP; 08 May 2020 09:45:59 -0700 From: Ferruh Yigit To: Pavan Nikhilesh , Jerin Jacob Cc: dev@dpdk.org, Ferruh Yigit , Thomas Monjalon , David Marchand , Konstantin Ananyev Date: Fri, 8 May 2020 17:45:46 +0100 Message-Id: <20200508164546.2489396-4-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200508164546.2489396-1-ferruh.yigit@intel.com> References: <20200507120259.2197813-1-ferruh.yigit@intel.com> <20200508164546.2489396-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 4/4] event/octeontx2: fix build for O1 optimization 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" Can be reproduced with "make EXTRA_CFLAGS='-O1'" command using gcc 7.3.0 Build error In file included from .../drivers/event/octeontx2/ot x2_evdev.c:15:0: .../drivers/event/octeontx2/otx2_evdev_stats.h: In function ‘otx2_sso_xstats_get’: .../drivers/event/octeontx2/otx2_evdev_stats.h:124:9: error: ‘xstats’ may be used uninitialized in this function [-Werror=maybe-uninitialized] xstat = &xstats[ids[i] - start_offset]; ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This is false positive, 'xstats_mode_count' should be preventing taking the loop and accessing 'xstats'. Returning in that case to silence the compiler warning. Reported-by: Konstantin Ananyev Signed-off-by: Ferruh Yigit --- drivers/event/octeontx2/otx2_evdev_stats.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/event/octeontx2/otx2_evdev_stats.h b/drivers/event/octeontx2/otx2_evdev_stats.h index 9d7c694ee6..74fcec8a07 100644 --- a/drivers/event/octeontx2/otx2_evdev_stats.h +++ b/drivers/event/octeontx2/otx2_evdev_stats.h @@ -67,7 +67,7 @@ otx2_sso_xstats_get(const struct rte_eventdev *event_dev, switch (mode) { case RTE_EVENT_DEV_XSTATS_DEVICE: - break; + return 0; case RTE_EVENT_DEV_XSTATS_PORT: if (queue_port_id >= (signed int)dev->nb_event_ports) goto invalid_value; -- 2.25.4