Thread (4 messages) 4 messages, 2 authors, 2009-10-27

[PATCH] icst307: Add missing increment

From: Roel Kluin <hidden>
Date: 2009-10-26 21:22:28
Also in: lkml
Subsystem: arm port, the rest · Maintainers: Russell King, Linus Torvalds

Without this increment the loop can only break if it does in the
first iteration.

Signed-off-by: Roel Kluin <redacted>
---
diff --git a/arch/arm/common/icst307.c b/arch/arm/common/icst307.c
index 6d094c1..b255fbf 100644
--- a/arch/arm/common/icst307.c
+++ b/arch/arm/common/icst307.c
@@ -55,7 +55,7 @@ icst307_khz_to_vco(const struct icst307_params *p, unsigned long freq)
 		 */
 		if (f > 6000 && f <= p->vco_max)
 			break;
-	} while (i < ARRAY_SIZE(idx2s));
+	} while (++i < ARRAY_SIZE(idx2s));
 
 	if (i >= ARRAY_SIZE(idx2s))
 		return vco;
@@ -117,7 +117,7 @@ icst307_ps_to_vco(const struct icst307_params *p, unsigned long period)
 		 */
 		if (f >= ps && f < 1000000000UL / 6000 + 1)
 			break;
-	} while (i < ARRAY_SIZE(idx2s));
+	} while (++i < ARRAY_SIZE(idx2s));
 
 	if (i >= ARRAY_SIZE(idx2s))
 		return vco;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help