aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/et131x
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2009-10-06 15:49:36 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2009-12-11 12:23:07 -0800
commit9251d71a4ec3e20189bb182cdc3af00f1152da81 (patch)
treeb04bf603ff7f55a281d9c0455250ffa94da13d67 /drivers/staging/et131x
parentc1996fc2ee1df6ecefe9f950f196cfc9b1d403e4 (diff)
Staging: et131x: Clean up the tx ring init
Keep this small change separate for bisectability Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/et131x')
-rw-r--r--drivers/staging/et131x/et1310_tx.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/staging/et131x/et1310_tx.c b/drivers/staging/et131x/et1310_tx.c
index 5fe72ba652f8..e9f30b5a3564 100644
--- a/drivers/staging/et131x/et1310_tx.c
+++ b/drivers/staging/et131x/et1310_tx.c
@@ -282,23 +282,19 @@ void et131x_init_send(struct et131x_adapter *adapter)
tx_ring->TCBReadyQueueHead = tcb;
- /* Go through and set up each TCB */
- for (ct = 0; ct < NUM_TCB; ct++) {
- memset(tcb, 0, sizeof(struct tcb));
+ memset(tcb, 0, sizeof(struct tcb) * NUM_TCB);
+ /* Go through and set up each TCB */
+ for (ct = 0; ct++ < NUM_TCB; tcb++) {
/* Set the link pointer in HW TCB to the next TCB in the
* chain. If this is the last TCB in the chain, also set the
* tail pointer.
*/
- if (ct < NUM_TCB - 1)
- tcb->Next = tcb + 1;
- else {
- tx_ring->TCBReadyQueueTail = tcb;
- tcb->Next = NULL;
- }
+ tcb->Next = tcb + 1;
- tcb++;
- }
+ tcb--;
+ tx_ring->TCBReadyQueueTail = tcb;
+ tcb->Next = NULL;
/* Curr send queue should now be empty */
tx_ring->CurrSendHead = NULL;
tx_ring->CurrSendTail = NULL;