Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <roel.kluin@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>

authored by

Roel Kluin and committed by
Dmitry Torokhov
4ab73761 bc34496d

+1 -1
+1 -1
drivers/input/serio/ambakmi.c
··· 57 57 struct amba_kmi_port *kmi = io->port_data; 58 58 unsigned int timeleft = 10000; /* timeout in 100ms */ 59 59 60 - while ((readb(KMISTAT) & KMISTAT_TXEMPTY) == 0 && timeleft--) 60 + while ((readb(KMISTAT) & KMISTAT_TXEMPTY) == 0 && --timeleft) 61 61 udelay(10); 62 62 63 63 if (timeleft)