Commit 9845b8f5 authored by Marc Kleine-Budde's avatar Marc Kleine-Budde

can: mcp251xfd: mcp251xfd_start_xmit(): use mcp251xfd_get_tx_free() to check TX is is full

This patch replaces an open coded check if the TX ring is full by a check if
mcp251xfd_get_tx_free() returns 0.

Link: https://lore.kernel.org/r/20210114153448.1506901-2-mkl@pengutronix.deSigned-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
parent cdc4c698
......@@ -2436,7 +2436,7 @@ static netdev_tx_t mcp251xfd_start_xmit(struct sk_buff *skb,
/* Stop queue if we occupy the complete TX FIFO */
tx_head = mcp251xfd_get_tx_head(tx_ring);
tx_ring->head++;
if (tx_ring->head - tx_ring->tail >= tx_ring->obj_num)
if (mcp251xfd_get_tx_free(tx_ring) == 0)
netif_stop_queue(ndev);
can_put_echo_skb(skb, ndev, tx_head, 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