Skip to contentSkip to conversation

input: i reaches -1

PATCH Applied Roel Kluin 2 participants 2 messages Jan 31, 2009 – Feb 2, 2009

Subsystems (2)
lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 input: i reaches -1

With a postfix decrement i reaches -1 rather than 0, but after the loop it is tested whether it has become 0.

---

drivers/input/mouse/pxa930_trkball.c +1 -1
index d297acc..1e827ad 100644
@@ -83,7 +83,7 @@ static int write_tbcr(struct pxa930_trkball *trkball, int v)
 
 	__raw_writel(v, trkball->mmio_base + TBCR);
 
-	while (i--) {
+	while (--i) {
 		if (__raw_readl(trkball->mmio_base + TBCR) == v)
 			break;
 		msleep(1);
maintainer Applied
#1 lore raw
Quoted 4 lines · Roel Kluin

With a postfix decrement i reaches -1 rather than 0, but after the loop it is tested whether it has become 0.

Applied, thank you Roel.

Signature · 1 line
Dmitry