From: Roel Kluin Date: Mon, 2 Feb 2009 00:55:45 +0000 (-0800) Subject: Input: ambakmi - fix timeout handling in amba_kmi_write() X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=4ab73761faef832f6d378328f79d21e77c62af3b;p=linux-2.6-omap-h63xx.git Input: ambakmi - fix timeout handling in amba_kmi_write() 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 Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/serio/ambakmi.c b/drivers/input/serio/ambakmi.c index af159c7d60b..e29cdc13a19 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)