patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Liron Himi <lironh@marvell.com>
To: Amit Prakash Shukla <amitprakashs@marvell.com>,
	Zyta Szpak <zr@semihalf.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	Jerin Jacob Kollanukkaran <jerinj@marvell.com>,
	"stable@dpdk.org" <stable@dpdk.org>,
	Amit Prakash Shukla <amitprakashs@marvell.com>,
	Liron Himi <lironh@marvell.com>
Subject: RE: [PATCH] net/mvneta: compilation fix for GCC-12
Date: Thu, 1 Sep 2022 08:36:15 +0000	[thread overview]
Message-ID: <PH0PR18MB4473FB83DA4848386C10B8AEC67B9@PH0PR18MB4473.namprd18.prod.outlook.com> (raw)
In-Reply-To: <20220901083118.3074981-1-amitprakashs@marvell.com>

Acked-by: Liron Himi <lironh@marvell.com>

-----Original Message-----
From: Amit Prakash Shukla <amitprakashs@marvell.com> 
Sent: Thursday, 1 September 2022 11:31
To: Zyta Szpak <zr@semihalf.com>; Liron Himi <lironh@marvell.com>
Cc: dev@dpdk.org; Jerin Jacob Kollanukkaran <jerinj@marvell.com>; stable@dpdk.org; Amit Prakash Shukla <amitprakashs@marvell.com>
Subject: [PATCH] net/mvneta: compilation fix for GCC-12

./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 <amitprakashs@marvell.com>
---
 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


  reply	other threads:[~2022-09-01  8:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-01  8:31 Amit Prakash Shukla
2022-09-01  8:36 ` Liron Himi [this message]
2022-09-16 14:56   ` Jerin Jacob

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=PH0PR18MB4473FB83DA4848386C10B8AEC67B9@PH0PR18MB4473.namprd18.prod.outlook.com \
    --to=lironh@marvell.com \
    --cc=amitprakashs@marvell.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=stable@dpdk.org \
    --cc=zr@semihalf.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).