staging: et131x: Simplify for loop in et131x_init_send()
authorMark Einon <mark.einon@gmail.com>
Mon, 29 Sep 2014 07:55:41 +0000 (08:55 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 29 Sep 2014 17:00:23 +0000 (13:00 -0400)
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.carpenter@oracle.com>
Signed-off-by: Mark Einon <mark.einon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/et131x/et131x.c

index 4973e6460e57c03f0c0acf4274ae341cb7e7fe34..384dc163851b3dd28bc51977306d4e1bec962575 100644 (file)
@@ -1751,7 +1751,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;
 
@@ -1759,8 +1759,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;