Commit 3d4ea02f authored by Ezequiel Garcia's avatar Ezequiel Garcia Committed by David S. Miller

net: mvneta: Clean-up mvneta_tx_frag_process()

A tiny clean-up to improve readability. This commit makes no functionality
change.
Signed-off-by: default avatarEzequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0a9e413b
...@@ -1654,9 +1654,9 @@ static int mvneta_tx_frag_process(struct mvneta_port *pp, struct sk_buff *skb, ...@@ -1654,9 +1654,9 @@ static int mvneta_tx_frag_process(struct mvneta_port *pp, struct sk_buff *skb,
struct mvneta_tx_queue *txq) struct mvneta_tx_queue *txq)
{ {
struct mvneta_tx_desc *tx_desc; struct mvneta_tx_desc *tx_desc;
int i; int i, nr_frags = skb_shinfo(skb)->nr_frags;
for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { for (i = 0; i < nr_frags; i++) {
skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
void *addr = page_address(frag->page.p) + frag->page_offset; void *addr = page_address(frag->page.p) + frag->page_offset;
...@@ -1673,20 +1673,16 @@ static int mvneta_tx_frag_process(struct mvneta_port *pp, struct sk_buff *skb, ...@@ -1673,20 +1673,16 @@ static int mvneta_tx_frag_process(struct mvneta_port *pp, struct sk_buff *skb,
goto error; goto error;
} }
if (i == (skb_shinfo(skb)->nr_frags - 1)) { if (i == nr_frags - 1) {
/* Last descriptor */ /* Last descriptor */
tx_desc->command = MVNETA_TXD_L_DESC | MVNETA_TXD_Z_PAD; tx_desc->command = MVNETA_TXD_L_DESC | MVNETA_TXD_Z_PAD;
txq->tx_skb[txq->txq_put_index] = skb; txq->tx_skb[txq->txq_put_index] = skb;
mvneta_txq_inc_put(txq);
} else { } else {
/* Descriptor in the middle: Not First, Not Last */ /* Descriptor in the middle: Not First, Not Last */
tx_desc->command = 0; tx_desc->command = 0;
txq->tx_skb[txq->txq_put_index] = NULL; txq->tx_skb[txq->txq_put_index] = NULL;
mvneta_txq_inc_put(txq);
} }
mvneta_txq_inc_put(txq);
} }
return 0; return 0;
......
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