DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	Junfeng Guo <junfeng.guo@intel.com>
Subject: [PATCH 1/4] gve: remove unnecessary null checks
Date: Wed,  9 Nov 2022 15:46:46 -0800	[thread overview]
Message-ID: <20221109234649.331942-2-stephen@networkplumber.org> (raw)
In-Reply-To: <20221109234649.331942-1-stephen@networkplumber.org>

The function rte_free() already handles NULL argument;
therefore the checks in this code are unnecessary.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/gve/gve_ethdev.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c
index 0086162f63b3..a05e61feba1f 100644
--- a/drivers/net/gve/gve_ethdev.c
+++ b/drivers/net/gve/gve_ethdev.c
@@ -81,12 +81,10 @@ gve_free_qpls(struct gve_priv *priv)
 	for (i = 0; i < nb_txqs + nb_rxqs; i++) {
 		if (priv->qpl[i].mz != NULL)
 			rte_memzone_free(priv->qpl[i].mz);
-		if (priv->qpl[i].page_buses != NULL)
-			rte_free(priv->qpl[i].page_buses);
+		rte_free(priv->qpl[i].page_buses);
 	}
 
-	if (priv->qpl != NULL)
-		rte_free(priv->qpl);
+	rte_free(priv->qpl);
 }
 
 static int
-- 
2.35.1


  reply	other threads:[~2022-11-09 23:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-09 23:46 [PATCH 0/4] " Stephen Hemminger
2022-11-09 23:46 ` Stephen Hemminger [this message]
2022-11-09 23:46 ` [PATCH 2/4] mlx5: " Stephen Hemminger
2022-11-09 23:46 ` [PATCH 3/4] idpf: remvoee " Stephen Hemminger
2022-11-09 23:46 ` [PATCH 4/4] examples: remove " Stephen Hemminger
2022-11-14 15:43   ` Dooley, Brian
2022-11-15 14:03 ` [PATCH 0/4] " Thomas Monjalon
2022-11-15 16:46   ` Stephen Hemminger
2022-11-15 17:23     ` Thomas Monjalon

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=20221109234649.331942-2-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=junfeng.guo@intel.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).