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 045D74585A for ; Wed, 11 Sep 2024 16:13:59 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E0C8C4029E; Wed, 11 Sep 2024 16:13:59 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 5BBC142E69 for ; Wed, 11 Sep 2024 16:13:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1726064037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=/lRm4XfL9aWPBeugJFC03kqG1e8ZVOGarWtp27Fca+I=; b=QwffEn1qmuoBiICUhEm34ZMFiazrGoR2Rbrg8tyW08c8QEg3UksuC4jykB3/0/8z7rjP1k +R9bz5jqhJiDMXo/SNuRVXe/VMxTE+icy3eVtOl5NEAIwjKfL875Z9M7/SMb1oBIdfofSL qzzj1j/je3myHzDppOiW9lrxOew6dM0= Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-201-43C1hBzAMmmiw55DdbteFw-1; Wed, 11 Sep 2024 10:13:55 -0400 X-MC-Unique: 43C1hBzAMmmiw55DdbteFw-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2CB8519B9A94; Wed, 11 Sep 2024 14:13:47 +0000 (UTC) Received: from rh.Home (unknown [10.39.192.55]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9208A1944B26; Wed, 11 Sep 2024 14:13:15 +0000 (UTC) From: Kevin Traynor To: stable@dpdk.org Cc: ktraynor@redhat.com, alialnu@nvidia.com Subject: [PATCH 21.11] net/softnic: fix maybe-uninitialized warning Date: Wed, 11 Sep 2024 15:12:59 +0100 Message-ID: <20240911141259.55514-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 In pmd_mtr_stats_read() 'struct rte_mtr_stats s' is initialized during the call to mtr_stats_convert() but on some systems it is triggering a compiler warning. e.g. drivers/net/softnic/rte_eth_softnic_meter.c:916:25: error: 's' may be used uninitialized [-Werror=maybe-uninitialized] Initialize the struct in pmd_mtr_stats_read() to avoid warnings. Reported-by: Ali Alnubani Signed-off-by: Kevin Traynor --- drivers/net/softnic/rte_eth_softnic_meter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/softnic/rte_eth_softnic_meter.c b/drivers/net/softnic/rte_eth_softnic_meter.c index 6b02f43e31..fea26f9c14 100644 --- a/drivers/net/softnic/rte_eth_softnic_meter.c +++ b/drivers/net/softnic/rte_eth_softnic_meter.c @@ -904,5 +904,5 @@ pmd_mtr_stats_read(struct rte_eth_dev *dev, /* Stats format conversion. */ if (stats || stats_mask) { - struct rte_mtr_stats s; + struct rte_mtr_stats s = {0}; uint64_t s_mask = 0; -- 2.46.0