The for loop in this function increments two variables and has an unusual
starting index of 1 (not 0). Make it look more familiar.

Reported-by: Dan Carpenter <dan.carpen...@oracle.com>
Signed-off-by: Mark Einon <mark.ei...@gmail.com>
---
 drivers/staging/et131x/et131x.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c
index d564859..30ee5e3 100644
--- a/drivers/staging/et131x/et131x.c
+++ b/drivers/staging/et131x/et131x.c
@@ -1747,7 +1747,7 @@ static void et131x_disable_txrx(struct net_device *netdev)
 
 static void et131x_init_send(struct et131x_adapter *adapter)
 {
-       u32 ct;
+       int i;
        struct tx_ring *tx_ring = &adapter->tx_ring;
        struct tcb *tcb = tx_ring->tcb_ring;
 
@@ -1755,8 +1755,10 @@ static void et131x_init_send(struct et131x_adapter 
*adapter)
 
        memset(tcb, 0, sizeof(struct tcb) * NUM_TCB);
 
-       for (ct = 0; ct++ < NUM_TCB; tcb++)
+       for (i = 0; i < NUM_TCB; i++) {
                tcb->next = tcb + 1;
+               tcb++;
+       }
 
        tcb--;
        tx_ring->tcb_qtail = tcb;
-- 
2.1.1

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to