Commit c52db246 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by David S. Miller

net: mvneta: remove unnecessary if condition in mvneta_xdp_submit_frame

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9c8c4402
...@@ -2083,7 +2083,7 @@ mvneta_xdp_submit_frame(struct mvneta_port *pp, struct mvneta_tx_queue *txq, ...@@ -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 skb_shared_info *sinfo = xdp_get_shared_info_from_frame(xdpf);
struct device *dev = pp->dev->dev.parent; 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; int i, num_frames = 1;
struct page *page; struct page *page;
...@@ -2140,10 +2140,8 @@ mvneta_xdp_submit_frame(struct mvneta_port *pp, struct mvneta_tx_queue *txq, ...@@ -2140,10 +2140,8 @@ mvneta_xdp_submit_frame(struct mvneta_port *pp, struct mvneta_tx_queue *txq,
mvneta_txq_inc_put(txq); mvneta_txq_inc_put(txq);
} }
/*last descriptor */ /*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->pending += num_frames;
txq->count += num_frames; txq->count += num_frames;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment