diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2020-12-20 16:02:29 +0300 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2021-01-27 12:01:46 +0300 |
commit | 9845b8f530196fd86fcc46c1c1298bf94b1604bf (patch) | |
tree | b9fa2fb5597961befb57eb8b94fcff1664bb4246 /drivers/net/can/spi | |
parent | cdc4c698e4be256634e722494dac0fa40e4137e2 (diff) | |
download | linux-9845b8f530196fd86fcc46c1c1298bf94b1604bf.tar.xz |
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.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can/spi')
-rw-r--r-- | drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c index 897c9310266a..1dbb87c28049 100644 --- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c +++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c @@ -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); |