All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] amba_kmi_write() timeleft reaches -1 rather than 0
@ 2009-01-31 13:33 Roel Kluin
  2009-02-02  1:07 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Roel Kluin @ 2009-01-31 13:33 UTC (permalink / raw
  To: Dmitry Torokhov, dtor; +Cc: linux-input

With a postfix decrement timeleft reaches -1 rather than 0,
but after the loop it is tested to have become 0.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/input/serio/ambakmi.c b/drivers/input/serio/ambakmi.c
index b10ffae..ab3299c 100644
--- a/drivers/input/serio/ambakmi.c
+++ b/drivers/input/serio/ambakmi.c
@@ -57,7 +57,7 @@ static int amba_kmi_write(struct serio *io, unsigned char val)
 	struct amba_kmi_port *kmi = io->port_data;
 	unsigned int timeleft = 10000; /* timeout in 100ms */
 
-	while ((readb(KMISTAT) & KMISTAT_TXEMPTY) == 0 && timeleft--)
+	while ((readb(KMISTAT) & KMISTAT_TXEMPTY) == 0 && --timeleft)
 		udelay(10);
 
 	if (timeleft)

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

* Re: [PATCH] amba_kmi_write() timeleft reaches -1 rather than 0
  2009-01-31 13:33 [PATCH] amba_kmi_write() timeleft reaches -1 rather than 0 Roel Kluin
@ 2009-02-02  1:07 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2009-02-02  1:07 UTC (permalink / raw
  To: Roel Kluin; +Cc: linux-input

On Sat, Jan 31, 2009 at 02:33:58PM +0100, Roel Kluin wrote:
> With a postfix decrement timeleft reaches -1 rather than 0,
> but after the loop it is tested to have 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:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-31 13:33 [PATCH] amba_kmi_write() timeleft reaches -1 rather than 0 Roel Kluin
2009-02-02  1:07 ` Dmitry Torokhov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.