Skip to content

Commit

Permalink
Staging: et131x: Clean up the tx ring init
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alan Cox authored and Greg Kroah-Hartman committed Dec 11, 2009
1 parent c1996fc commit 9251d71
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions drivers/staging/et131x/et1310_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9251d71

Please sign in to comment.