All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo@kernel.org>
To: netdev@vger.kernel.org
Cc: lorenzo.bianconi@redhat.com, thomas.petazzoni@bootlin.com,
	davem@davemloft.net, kuba@kernel.org, dan.carpenter@oracle.com
Subject: [PATCH net-next] net: mvneta: remove unnecessary if condition in mvneta_xdp_submit_frame
Date: Thu, 27 Jan 2022 15:47:49 +0100	[thread overview]
Message-ID: <d7b846d1caf1f59612eead3d8760e7a6913695ba.1643294657.git.lorenzo@kernel.org> (raw)

Get rid of unnecessary if check on tx_desc pointer in
mvneta_xdp_submit_frame routine since num_frames is always greater than
0 and tx_desc pointer is always initialized.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/ethernet/marvell/mvneta.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index 315a43e4c63d..f1335a1ed695 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -2083,7 +2083,7 @@ mvneta_xdp_submit_frame(struct mvneta_port *pp, struct mvneta_tx_queue *txq,
 {
 	struct skb_shared_info *sinfo = xdp_get_shared_info_from_frame(xdpf);
 	struct device *dev = pp->dev->dev.parent;
-	struct mvneta_tx_desc *tx_desc = NULL;
+	struct mvneta_tx_desc *tx_desc;
 	int i, num_frames = 1;
 	struct page *page;
 
@@ -2140,10 +2140,8 @@ mvneta_xdp_submit_frame(struct mvneta_port *pp, struct mvneta_tx_queue *txq,
 
 		mvneta_txq_inc_put(txq);
 	}
-
 	/*last descriptor */
-	if (likely(tx_desc))
-		tx_desc->command |= MVNETA_TXD_L_DESC | MVNETA_TXD_Z_PAD;
+	tx_desc->command |= MVNETA_TXD_L_DESC | MVNETA_TXD_Z_PAD;
 
 	txq->pending += num_frames;
 	txq->count += num_frames;
-- 
2.34.1


             reply	other threads:[~2022-01-27 14:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-27 14:47 Lorenzo Bianconi [this message]
2022-01-28 14:40 ` [PATCH net-next] net: mvneta: remove unnecessary if condition in mvneta_xdp_submit_frame patchwork-bot+netdevbpf

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=d7b846d1caf1f59612eead3d8760e7a6913695ba.1643294657.git.lorenzo@kernel.org \
    --to=lorenzo@kernel.org \
    --cc=dan.carpenter@oracle.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=thomas.petazzoni@bootlin.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.