From patchwork Tue Apr 4 06:55:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jerin Jacob Kollanukkaran X-Patchwork-Id: 125750 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 98733428CB; Tue, 4 Apr 2023 08:55:46 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E39BD41153; Tue, 4 Apr 2023 08:55:45 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id B3B6B40EE3; Tue, 4 Apr 2023 08:55:43 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 333IbSjv023040; Mon, 3 Apr 2023 23:55:41 -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-type : content-transfer-encoding; s=pfpt0220; bh=eUMPvZunzmg/MHAS8a1exfrpNOWWQcynOjDPEq9mNpo=; b=aogSOya77h6hInLbqxiq8dwWVIDIoxdFum4TvhIViohAxTcJIOZt2eO5s6wqToMTq3b7 Mi2Qm9cT80HpuNrHH+jdxpcMqrl/oilD1toqvQrz5TWkJe/JtIn+zrJJAUQSF3OBB8jx 6jUGAVuVHpyIUgmPXXbRohyHA6iVKSTYBqnKCIVI8Sy9zMDuhSgItRHFpKsjL1GtwWLt 5mu+ce8vac/uzK7unM7ldQ7yryLMxx/9NOllIsaccLQH38/mcyM8nIVGFY/LEukrb1rg 8qtozEd4Vm99xpQKicdkm2N2/+wzJAAJXZLCq1CXJwpc2wgCqmf1SdjA89LOKool5zz+ Og== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3pr483b8u9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 03 Apr 2023 23:55:40 -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.48; Mon, 3 Apr 2023 23:55:39 -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.48 via Frontend Transport; Mon, 3 Apr 2023 23:55:39 -0700 Received: from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14]) by maili.marvell.com (Postfix) with ESMTP id 254C55B6930; Mon, 3 Apr 2023 23:55:35 -0700 (PDT) From: To: , Dongdong Liu , Yisen Zhuang , Huisong Li , "Min Hu (Connor)" CC: , , , , Jerin Jacob , Subject: [PATCH] net/hns3: fix build warning Date: Tue, 4 Apr 2023 12:25:25 +0530 Message-ID: <20230404065525.3313249-1-jerinj@marvell.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 X-Proofpoint-GUID: oCRohcsxsWCakOiNm2lAlg68b2T4bbea X-Proofpoint-ORIG-GUID: oCRohcsxsWCakOiNm2lAlg68b2T4bbea X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-03_19,2023-04-03_03,2023-02-09_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 From: Jerin Jacob aarch64 gcc 12.2.0 build complain with below warning[1]. Move the new_link initialization upwards to fix the warning. Compiling C object drivers/libtmp_rte_net_hns3.a.p/net_hns3_hns3_ethdev.c.o drivers/net/hns3/hns3_ethdev.c: In function ‘hns3_dev_link_update’: drivers/net/hns3/hns3_ethdev.c:2249:1: warning: ‘new_link’ may be used uninitialized [-Wmaybe-uninitialized] Fixes: 64308555d5bf ("net/hns3: fix link status when port is stopped") Cc: stable@dpdk.org Signed-off-by: Jerin Jacob Acked-by: Dongdong Liu --- drivers/net/hns3/hns3_ethdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index 36896f8989..a872cb8dd7 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -2257,6 +2257,7 @@ hns3_dev_link_update(struct rte_eth_dev *eth_dev, int wait_to_complete) struct rte_eth_link new_link; int ret; + memset(&new_link, 0, sizeof(new_link)); /* When port is stopped, report link down. */ if (eth_dev->data->dev_started == 0) { new_link.link_autoneg = mac->link_autoneg; @@ -2280,7 +2281,6 @@ hns3_dev_link_update(struct rte_eth_dev *eth_dev, int wait_to_complete) rte_delay_ms(HNS3_LINK_CHECK_INTERVAL); } while (retry_cnt--); - memset(&new_link, 0, sizeof(new_link)); hns3_setup_linkstatus(eth_dev, &new_link); out: