提交 4831539d 编写于 作者: I Ilias Apalodimas 提交者: David S. Miller

net: netsec: remove superfluous if statement

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: NIlias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 c099a408
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册