From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0E1EDA0C4B; Fri, 15 Oct 2021 12:28:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ECF07411CB; Fri, 15 Oct 2021 12:28:28 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id D8FB7410F1 for ; Fri, 15 Oct 2021 12:28:26 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10137"; a="226664117" X-IronPort-AV: E=Sophos;i="5.85,375,1624345200"; d="scan'208";a="226664117" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Oct 2021 03:28:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,375,1624345200"; d="scan'208";a="592938208" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.27]) by orsmga004.jf.intel.com with ESMTP; 15 Oct 2021 03:28:20 -0700 From: Ferruh Yigit To: John Daley , Hyong Youb Kim , Andrew Rybchenko Cc: Ferruh Yigit , dev@dpdk.org, David Marchand Date: Fri, 15 Oct 2021 11:28:18 +0100 Message-Id: <20211015102819.4101559-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] net/enic: fix build with GCC 7.5 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" Build error: ../drivers/net/enic/enic_fm_flow.c: In function 'enic_fm_flow_parse': ../drivers/net/enic/enic_fm_flow.c:1467:24: error: 'dev' may be used uninitialized in this function [-Werror=maybe-uninitialized] struct rte_eth_dev *dev; ^~~ ../drivers/net/enic/enic_fm_flow.c:1580:24: error: 'dev' may be used uninitialized in this function [-Werror=maybe-uninitialized] struct rte_eth_dev *dev; ^~~ ../drivers/net/enic/enic_fm_flow.c:1599:24: error: 'dev' may be used uninitialized in this function [-Werror=maybe-uninitialized] struct rte_eth_dev *dev; ^~~ Build error looks like false positive, but to silence the compiler initializing the pointer with NULL. Fixes: 7968917ccf64 ("net/enic: support meta flow actions to overrule destinations") Reported-by: David Marchand Signed-off-by: Ferruh Yigit --- Cc: andrew.rybchenko@oktetlabs.ru I am not sure about the solution and I don't have environment to verify, sending this patch to verify the solution in CI and trigger discussion for fix. The patch is still in next-net, when a proper fix is found, it can be squashed in next-net. --- drivers/net/enic/enic_fm_flow.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/enic/enic_fm_flow.c b/drivers/net/enic/enic_fm_flow.c index 4092ff1f6154..2c60bb864e23 100644 --- a/drivers/net/enic/enic_fm_flow.c +++ b/drivers/net/enic/enic_fm_flow.c @@ -1464,7 +1464,7 @@ enic_fm_copy_action(struct enic_flowman *fm, } case RTE_FLOW_ACTION_TYPE_PORT_ID: { const struct rte_flow_action_port_id *port; - struct rte_eth_dev *dev; + struct rte_eth_dev *dev = NULL; if (!ingress && (overlap & PORT_ID)) { ENICPMD_LOG(DEBUG, "cannot have multiple egress PORT_ID actions"); @@ -1577,7 +1577,7 @@ enic_fm_copy_action(struct enic_flowman *fm, } case RTE_FLOW_ACTION_TYPE_PORT_REPRESENTOR: { const struct rte_flow_action_ethdev *ethdev; - struct rte_eth_dev *dev; + struct rte_eth_dev *dev = NULL; ethdev = actions->conf; ret = enic_fm_check_transfer_dst(enic, ethdev->port_id, @@ -1596,7 +1596,7 @@ enic_fm_copy_action(struct enic_flowman *fm, } case RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT: { const struct rte_flow_action_ethdev *ethdev; - struct rte_eth_dev *dev; + struct rte_eth_dev *dev = NULL; if (overlap & PORT_ID) { ENICPMD_LOG(DEBUG, "cannot have multiple egress PORT_ID actions"); -- 2.31.1