Skip to contentSkip to conversation

icst307: Add missing increment

PATCH In review Roel Kluin 2 participants 4 messages Oct 26, 2009 – Oct 27, 2009 Arm (32-bit)

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 icst307: Add missing increment

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

---

arch/arm/common/icst307.c +2 -2
index 6d094c1..b255fbf 100644
@@ -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;
author
#1 lore raw

PATCH 1/1 icst525: Add missing increment

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

---
 arch/arm/common/icst525.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Same issue, different file.

arch/arm/common/icst525.c +2 -2
index 3d377c5..0aef96a 100644
@@ -53,7 +53,7 @@ icst525_khz_to_vco(const struct icst525_params *p, unsigned long freq)
 		 */
 		if (f > 10000 && f <= p->vco_max)
 			break;
-	} while (i < ARRAY_SIZE(idx2s));
+	} while (++i < ARRAY_SIZE(idx2s));
 
 	if (i >= ARRAY_SIZE(idx2s))
 		return vco;
@@ -116,7 +116,7 @@ icst525_ps_to_vco(const struct icst525_params *p, unsigned long period)
 		 */
 		if (f >= ps && f < 100000)
 			break;
-	} while (i < ARRAY_SIZE(idx2s));
+	} while (++i < ARRAY_SIZE(idx2s));
 
 	if (i >= ARRAY_SIZE(idx2s))
 		return vco;
#2 lore raw

Re: [PATCH] icst525: Add missing increment

Quoted 2 lines · Roel Kluin

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

Ok.