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 676C8A00C5 for ; Thu, 1 Sep 2022 10:31:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5C897427F1; Thu, 1 Sep 2022 10:31:30 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 67FAE40395; Thu, 1 Sep 2022 10:31:27 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2811ZK1L020763; Thu, 1 Sep 2022 01:31:26 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=HYRhNOCq3Qm9YamUHbqtJa+7wK7cjDfkeK9qQfxbW14=; b=InLOQC8PA7nYSyEFxoHvScxNX+OtbkkfU6pEVMHO6vjggRiQhSw1yzuF2i3J4mm5CI/q XNr7yQcYvDi8WXji2OLqinq7yM8yxJNFtOCFEOit4K2W6D3SYOrSttKKRulAUXTB9mxQ CMnQi6E6IOMPtUCybWll5KtfhG4rTmCtkLWN++Rx0eArBjM9LfP08MyY/kE41c6g83Et fOl6nTyHDaVGe1gdHFXg78aEvMQj0POP5eiBW8zSLVpXpf760PM2HP/zNXqxqowZ49f4 jxupAlG16Dgh7mf77DQO9Kd9TP5ux1r6sntXj6YtymwHvrdXETso8nR5ge8HzyhJOj7T 8g== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3jak731a5a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 01 Sep 2022 01:31:26 -0700 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; Thu, 1 Sep 2022 01:31:25 -0700 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; Thu, 1 Sep 2022 01:31:25 -0700 Received: from localhost.localdomain (unknown [10.28.36.157]) by maili.marvell.com (Postfix) with ESMTP id AE1FE3F7050; Thu, 1 Sep 2022 01:31:22 -0700 (PDT) From: Amit Prakash Shukla To: Zyta Szpak , Liron Himi CC: , , , "Amit Prakash Shukla" Subject: [PATCH] net/mvneta: compilation fix for GCC-12 Date: Thu, 1 Sep 2022 14:01:18 +0530 Message-ID: <20220901083118.3074981-1-amitprakashs@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: SGOrO4nipE0yHJhw_aI3U7LiPsN1gu4p X-Proofpoint-ORIG-GUID: SGOrO4nipE0yHJhw_aI3U7LiPsN1gu4p X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-09-01_06,2022-08-31_03,2022-06-22_01 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org ./drivers/net/mvneta/mvneta_rxtx.c:89:42: error: 'mbufs' may be used uninitialized [-Werror=maybe-uninitialized] 89 | MVNETA_SET_COOKIE_HIGH_ADDR(mbufs[0]); | ^ ../drivers/net/mvneta/mvneta_rxtx.c:77:26: note: 'mbufs' declared here 77 | struct rte_mbuf *mbufs[MRVL_NETA_BUF_RELEASE_BURST_SIZE_MAX]; | ^~~~~ Fixes: ce7ea764597e ("net/mvneta: support Rx/Tx") Cc: stable@dpdk.org Signed-off-by: Amit Prakash Shukla --- drivers/net/mvneta/mvneta_rxtx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/mvneta/mvneta_rxtx.c b/drivers/net/mvneta/mvneta_rxtx.c index 6e4a7896b4..952e982275 100644 --- a/drivers/net/mvneta/mvneta_rxtx.c +++ b/drivers/net/mvneta/mvneta_rxtx.c @@ -79,6 +79,10 @@ mvneta_buffs_refill(struct mvneta_priv *priv, struct mvneta_rxq *rxq, u16 *num) int i, ret; uint16_t nb_desc = *num; + /* To prevent GCC-12 warning. */ + if (unlikely(nb_desc == 0)) + return -1; + ret = rte_pktmbuf_alloc_bulk(rxq->mp, mbufs, nb_desc); if (ret) { MVNETA_LOG(ERR, "Failed to allocate %u mbufs.", nb_desc); -- 2.25.1