[PATCH 110/235] Staging: et131x: Clean up the tx ring init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Alan Cox <alan@xxxxxxxxxxxxxxx>

Keep this small change separate for bisectability

Signed-off-by: Alan Cox <alan@xxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>
---
 drivers/staging/et131x/et1310_tx.c |   20 ++++++++------------
 1 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/et131x/et1310_tx.c b/drivers/staging/et131x/et1310_tx.c
index 5fe72ba..e9f30b5 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;
-- 
1.6.5.5

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

[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux