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 5A9B9A0351; Fri, 4 Mar 2022 15:23:58 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A884F427CD; Fri, 4 Mar 2022 15:23:57 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id C2DF54013F; Fri, 4 Mar 2022 15:23:55 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 224DxdgZ020173; Fri, 4 Mar 2022 06:23:54 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-type : content-transfer-encoding; s=pfpt0220; bh=YQmxuoJQ5NATl6RnW2cBvPsSEvK9TVevHx1Hh+ecu10=; b=CyH4Rn9T2epPgEtM6AFyNK4GJqnE/JBEezAiu3bQ0ABXUhSIlD+4KGM6sQBkixSwnVwy ZzZWpfbUoha8UJcYI8yySJ8iV1QAHWjphdZ6QYfzArWHOjCb6lbrrsbQNErv4ivyDwqr GNNAXPhRNLgbYXfhboQIgi7nMCZ1vtd8oCgTOr1ynhuor/QsulhwQGLmB7g4dSkQ0bNt jf8UpVMur+m10qcPphPRd5METR74N45eEhrdp8QFD2lL/jF/7rwvPAYZ0ygbfadQSJR/ okaqbhAzgrU7lQK6ztlZ2Almiooi5sX7dQruYxV76OpqEQPELHjcFc7EXFgIP7ZoL0rD FA== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3ekm50r2w1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 04 Mar 2022 06:23:54 -0800 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 4 Mar 2022 06:23:53 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 4 Mar 2022 06:23:53 -0800 Received: from localhost.localdomain (unknown [10.28.48.103]) by maili.marvell.com (Postfix) with ESMTP id 3FE623F7069; Fri, 4 Mar 2022 06:23:50 -0800 (PST) From: Rakesh Kudurumalla To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: , , Rakesh Kudurumalla , , Ferruh Yigit Subject: [PATCH] net/cnxk: fix error when compiled for x86 Date: Fri, 4 Mar 2022 19:53:37 +0530 Message-ID: <20220304142337.911828-1-rkudurumalla@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Proofpoint-ORIG-GUID: C_FoM-0tuUfEHsx2taiTsU1NNLQnPy4c X-Proofpoint-GUID: C_FoM-0tuUfEHsx2taiTsU1NNLQnPy4c X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-03-04_06,2022-03-04_01,2022-02-23_01 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 fix error when compiled for x86 platform when compiled with optimization flag enabled error: ‘str’ may be used uninitialized in this function error: ‘frag_ptr’ may be used uninitialized in this function Bugzilla ID: 939 Fixes: b526599020ef ("net/cnxk: fix build with GCC 12") Cc: stable@dpdk.org Reported-by: Ferruh Yigit Signed-off-by: Rakesh Kudurumalla --- drivers/net/cnxk/cn10k_rx.h | 5 +++-- drivers/net/cnxk/cnxk_ethdev_mtr.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/cnxk/cn10k_rx.h b/drivers/net/cnxk/cn10k_rx.h index 7f219e5ddd..e4f5a553a6 100644 --- a/drivers/net/cnxk/cn10k_rx.h +++ b/drivers/net/cnxk/cn10k_rx.h @@ -146,7 +146,8 @@ nix_sec_attach_frags(const struct cpt_parse_hdr_s *hdr, uint32_t offset = hdr->w2.fi_offset; union nix_rx_parse_u *frag_rx; struct cpt_frag_info_s *finfo; - uint64_t *frag_ptr, ol_flags; + uint64_t *frag_ptr = NULL; + uint64_t ol_flags; uint16_t frag_size; uint16_t rlen; uint64_t *wqe; @@ -276,8 +277,8 @@ nix_sec_reassemble_frags(const struct cpt_parse_hdr_s *hdr, uint64_t cq_w1, union nix_rx_parse_u *frag_rx; struct cpt_frag_info_s *finfo; struct rte_mbuf *head, *mbuf; + uint64_t *frag_ptr = NULL; rte_iova_t *inner_iova; - uint64_t *frag_ptr; uint16_t frag_size; uint64_t *wqe; diff --git a/drivers/net/cnxk/cnxk_ethdev_mtr.c b/drivers/net/cnxk/cnxk_ethdev_mtr.c index c8183aa12d..02803bdf75 100644 --- a/drivers/net/cnxk/cnxk_ethdev_mtr.c +++ b/drivers/net/cnxk/cnxk_ethdev_mtr.c @@ -288,7 +288,7 @@ cnxk_nix_mtr_profile_delete(struct rte_eth_dev *eth_dev, uint32_t profile_id, static int update_mtr_err(uint32_t act_color, struct rte_mtr_error *error, bool action) { - const char *str; + const char *str = NULL; switch (act_color) { case RTE_COLOR_GREEN: if (action) { -- 2.25.1