diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2020-03-06 23:54:47 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-03-09 19:07:42 -0700 |
commit | a0e6650bdd25c93c64101c09cc842e47cadcd08c (patch) | |
tree | 4ae66ffc6f65c739be36f5e1dbfd893d9e128b85 /drivers | |
parent | 206bd0a735d432d8dcb8e60d1cc2f5bf9ee9aa0f (diff) |
r8169: convert while to for loop in rtl_tx
Slightly improve the code by converting this while to a for loop.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/realtek/r8169_main.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index 4495a3cf96d2..c0999efa0c8a 100644 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -4392,9 +4392,8 @@ static void rtl_tx(struct net_device *dev, struct rtl8169_private *tp, dirty_tx = tp->dirty_tx; smp_rmb(); - tx_left = tp->cur_tx - dirty_tx; - while (tx_left > 0) { + for (tx_left = tp->cur_tx - dirty_tx; tx_left > 0; tx_left--) { unsigned int entry = dirty_tx % NUM_TX_DESC; struct ring_info *tx_skb = tp->tx_skb + entry; u32 status; @@ -4418,7 +4417,6 @@ static void rtl_tx(struct net_device *dev, struct rtl8169_private *tp, tx_skb->skb = NULL; } dirty_tx++; - tx_left--; } if (tp->dirty_tx != dirty_tx) { |