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>,
	Jingjing Wu <jingjing.wu@intel.com>,
	Beilei Xing <beilei.xing@intel.com>
Subject: [PATCH 3/4] idpf: remvoee unnecessary null checks
Date: Wed,  9 Nov 2022 15:46:48 -0800	[thread overview]
Message-ID: <20221109234649.331942-4-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/idpf/idpf_rxtx.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/idpf/idpf_rxtx.c b/drivers/net/idpf/idpf_rxtx.c
index bafa007faf85..b1f58089e031 100644
--- a/drivers/net/idpf/idpf_rxtx.c
+++ b/drivers/net/idpf/idpf_rxtx.c
@@ -251,8 +251,7 @@ reset_single_rx_queue(struct idpf_rx_queue *rxq)
 	rxq->rx_tail = 0;
 	rxq->nb_rx_hold = 0;
 
-	if (rxq->pkt_first_seg != NULL)
-		rte_pktmbuf_free(rxq->pkt_first_seg);
+	rte_pktmbuf_free(rxq->pkt_first_seg);
 
 	rxq->pkt_first_seg = NULL;
 	rxq->pkt_last_seg = NULL;
-- 
2.35.1


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

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-09 23:46 [PATCH 0/4] remove " Stephen Hemminger
2022-11-09 23:46 ` [PATCH 1/4] gve: " Stephen Hemminger
2022-11-09 23:46 ` [PATCH 2/4] mlx5: " Stephen Hemminger
2022-11-09 23:46 ` Stephen Hemminger [this message]
2022-11-09 23:46 ` [PATCH 4/4] examples: " 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-4-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@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).