All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: mvneta: remove unnecessary if condition in mvneta_xdp_submit_frame
@ 2022-01-27 14:47 Lorenzo Bianconi
  2022-01-28 14:40 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Lorenzo Bianconi @ 2022-01-27 14:47 UTC (permalink / raw)
  To: netdev; +Cc: lorenzo.bianconi, thomas.petazzoni, davem, kuba, dan.carpenter

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] net: mvneta: remove unnecessary if condition in mvneta_xdp_submit_frame
  2022-01-27 14:47 [PATCH net-next] net: mvneta: remove unnecessary if condition in mvneta_xdp_submit_frame Lorenzo Bianconi
@ 2022-01-28 14:40 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-01-28 14:40 UTC (permalink / raw)
  To: Lorenzo Bianconi
  Cc: netdev, lorenzo.bianconi, thomas.petazzoni, davem, kuba, dan.carpenter

Hello:

This patch was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:

On Thu, 27 Jan 2022 15:47:49 +0100 you wrote:
> 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>
> 
> [...]

Here is the summary with links:
  - [net-next] net: mvneta: remove unnecessary if condition in mvneta_xdp_submit_frame
    https://git.kernel.org/netdev/net-next/c/c52db2461917

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-28 14:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-27 14:47 [PATCH net-next] net: mvneta: remove unnecessary if condition in mvneta_xdp_submit_frame Lorenzo Bianconi
2022-01-28 14:40 ` patchwork-bot+netdevbpf

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.