Skip to content

Commit

Permalink
net: netsec: remove superfluous if statement
Browse files Browse the repository at this point in the history
While freeing tx buffers the memory has to be unmapped if the packet was
an skb or was used for .ndo_xdp_xmit using the same arguments. Get rid
of the unneeded extra 'else if' statement

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ilias Apalodimas authored and David S. Miller committed Jul 9, 2019
1 parent c099a40 commit 4831539
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/net/ethernet/socionext/netsec.c
Original file line number Diff line number Diff line change
Expand Up @@ -654,12 +654,12 @@ static bool netsec_clean_tx_dring(struct netsec_priv *priv)
eop = (entry->attr >> NETSEC_TX_LAST) & 1;
dma_rmb();

if (desc->buf_type == TYPE_NETSEC_SKB)
/* if buf_type is either TYPE_NETSEC_SKB or
* TYPE_NETSEC_XDP_NDO we mapped it
*/
if (desc->buf_type != TYPE_NETSEC_XDP_TX)
dma_unmap_single(priv->dev, desc->dma_addr, desc->len,
DMA_TO_DEVICE);
else if (desc->buf_type == TYPE_NETSEC_XDP_NDO)
dma_unmap_single(priv->dev, desc->dma_addr,
desc->len, DMA_TO_DEVICE);

if (!eop)
goto next;
Expand Down

0 comments on commit 4831539

Please sign in to comment.