Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 46dfc23e authored by Colin Ian King's avatar Colin Ian King Committed by David S. Miller
Browse files

via-velocity: remove null pointer check on array tdinfo->skb_dma



tdinfo->skb_dma is a 7 element array of dma_addr_t hence cannot be
null, so the pull pointer check on tdinfo->skb_dma  is redundant.
Remove it.

Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Acked-by: default avatarFrancois Romieu <romieu@fr.zoreil.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9438451e
Loading
Loading
Loading
Loading
+9 −12
Original line number Diff line number Diff line
@@ -1724,13 +1724,11 @@ static void velocity_free_tx_buf(struct velocity_info *vptr,
		struct velocity_td_info *tdinfo, struct tx_desc *td)
{
	struct sk_buff *skb = tdinfo->skb;
	int i;

	/*
	 *	Don't unmap the pre-allocated tx_bufs
	 */
	if (tdinfo->skb_dma) {
		int i;

	for (i = 0; i < tdinfo->nskb_dma; i++) {
		size_t pktlen = max_t(size_t, skb->len, ETH_ZLEN);

@@ -1742,7 +1740,6 @@ static void velocity_free_tx_buf(struct velocity_info *vptr,
		dma_unmap_single(vptr->dev, tdinfo->skb_dma[i],
				 le16_to_cpu(pktlen), DMA_TO_DEVICE);
	}
	}
	dev_kfree_skb_irq(skb);
	tdinfo->skb = NULL;
}