Skip to contentSkip to conversation

prevent that myri_do_handshake lies about ticks in drivers/net/myri_sbus.c

PATCH In review Roel Kluin 2 participants 2 messages Nov 5, 2007 – Nov 13, 2007

Subsystems (2)
lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 prevent that myri_do_handshake lies about ticks in drivers/net/myri_sbus.c

With '<=' tick can be incremented up to 26, The last loop is redundant since even when 'softstate' becomes 'STATE_READY', 'if (tick > 25)' will still cause the function to return -1,

---

drivers/net/myri_sbus.c +1 -1
index 8d29319..656a260 100644
@@ -134,7 +134,7 @@ static int myri_do_handshake(struct myri_eth *mp)
 
 	myri_disable_irq(mp->lregs, cregs);
 
-	while (tick++ <= 25) {
+	while (tick++ < 25) {
 		u32 softstate;
 
 		/* Wake it up. */
maintainer
#1 lore raw

From: Roel Kluin <[email protected]>
Date: Mon, 05 Nov 2007 16:06:11 +0100

Quoted 5 lines

With '<=' tick can be incremented up to 26, The last loop is redundant since even when 'softstate' becomes 'STATE_READY', 'if (tick > 25)' will still cause the function to return -1,

Patch applied, thanks.