dz: test after postfix decrement fails in dz_console_putchar()
authorRoel Kluin <12o3l@tiscali.nl>
Mon, 28 Apr 2008 09:11:50 +0000 (02:11 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 28 Apr 2008 15:58:16 +0000 (08:58 -0700)
When loops reaches 0 the postfix decrement still subtracts, so the subsequent
test fails.

Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
Acked-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: Johannes Weiner <hannes@saeurebad.de>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/serial/dz.c

index 116211fcd36fc196ff12de4aeb36ee8e6194031f..0dddd68b20d27de2dd4e5a8802e4931e954f493b 100644 (file)
@@ -819,7 +819,7 @@ static void dz_console_putchar(struct uart_port *uport, int ch)
                dz_out(dport, DZ_TCR, mask);
                iob();
                udelay(2);
-       } while (loops--);
+       } while (--loops);
 
        if (loops)                              /* Cannot send otherwise. */
                dz_out(dport, DZ_TDR, ch);