Commit a0e6650b authored by Heiner Kallweit's avatar Heiner Kallweit Committed by David S. Miller

r8169: convert while to for loop in rtl_tx

Slightly improve the code by converting this while to a for loop.
Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 206bd0a7
...@@ -4392,9 +4392,8 @@ static void rtl_tx(struct net_device *dev, struct rtl8169_private *tp, ...@@ -4392,9 +4392,8 @@ static void rtl_tx(struct net_device *dev, struct rtl8169_private *tp,
dirty_tx = tp->dirty_tx; dirty_tx = tp->dirty_tx;
smp_rmb(); 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; unsigned int entry = dirty_tx % NUM_TX_DESC;
struct ring_info *tx_skb = tp->tx_skb + entry; struct ring_info *tx_skb = tp->tx_skb + entry;
u32 status; u32 status;
...@@ -4418,7 +4417,6 @@ static void rtl_tx(struct net_device *dev, struct rtl8169_private *tp, ...@@ -4418,7 +4417,6 @@ static void rtl_tx(struct net_device *dev, struct rtl8169_private *tp,
tx_skb->skb = NULL; tx_skb->skb = NULL;
} }
dirty_tx++; dirty_tx++;
tx_left--;
} }
if (tp->dirty_tx != dirty_tx) { if (tp->dirty_tx != dirty_tx) {
......
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