From patchwork Mon May 11 16:07:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 70090 X-Patchwork-Delegate: thomas@monjalon.net 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 904B4A0350; Mon, 11 May 2020 18:08:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 537A61C1CB; Mon, 11 May 2020 18:07:51 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id C16D01C10B for ; Mon, 11 May 2020 18:07:46 +0200 (CEST) IronPort-SDR: iSWzAg52jtuBlqZ2l8aeUrIlX/9zbl11oEoKogZ4vwNySnE61W/04yyIPGpsRS+U/qAHnILzwc j00AVc8o46Xw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2020 09:07:37 -0700 IronPort-SDR: qn3w5pBSVsEpxbm6B+B12KqsQXIEYbugPYpl4RoMar0MUB/ZDoY3yk8rv+N1BywhXcCdoMJg7q TN86jc+eQbtw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,380,1583222400"; d="scan'208";a="265201409" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.180]) by orsmga006.jf.intel.com with ESMTP; 11 May 2020 09:07:35 -0700 From: Ferruh Yigit To: Pavan Nikhilesh , Jerin Jacob Cc: dev@dpdk.org, Ferruh Yigit , Thomas Monjalon , David Marchand , Konstantin Ananyev Date: Mon, 11 May 2020 17:07:25 +0100 Message-Id: <20200511160725.1497902-4-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200511160725.1497902-1-ferruh.yigit@intel.com> References: <20200507120259.2197813-1-ferruh.yigit@intel.com> <20200511160725.1497902-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 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 Tested-by: Konstantin Ananyev Acked-by: Konstantin Ananyev Acked-by: Jerin Jacob --- 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;