linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] input: i reaches -1
@ 2009-01-31 10:25 Roel Kluin
  2009-02-02  1:06 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2009-01-31 10:25 UTC (permalink / raw)
  To: Dmitry Torokhov, dtor; +Cc: linux-input

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

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/input/mouse/pxa930_trkball.c b/drivers/input/mouse/pxa930_trkball.c
index d297acc..1e827ad 100644
--- a/drivers/input/mouse/pxa930_trkball.c
+++ b/drivers/input/mouse/pxa930_trkball.c
@@ -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);

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] input: i reaches -1
  2009-01-31 10:25 [PATCH] input: i reaches -1 Roel Kluin
@ 2009-02-02  1:06 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2009-02-02  1:06 UTC (permalink / raw)
  To: Roel Kluin; +Cc: linux-input

On Sat, Jan 31, 2009 at 11:25:32AM +0100, Roel Kluin wrote:
> With a postfix decrement i reaches -1 rather than 0,
> but after the loop it is tested whether it has become 0.
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>

Applied, thank you Roel.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-02-02  1:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-31 10:25 [PATCH] input: i reaches -1 Roel Kluin
2009-02-02  1:06 ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).