From: Roel Kluin <12o3l@tiscali.nl> Date: Mon, 28 Apr 2008 17:15:41 +0000 (+0000) Subject: dz: test after postfix decrement fails in dz_console_putchar() X-Git-Tag: v2.6.25.1~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35a398abdc1b5111b62bca9174bc5ccf973ab6dc;p=thirdparty%2Fkernel%2Fstable.git dz: test after postfix decrement fails in dz_console_putchar() commit 1ecf0d0cd28a4bfed3009f752061998e52d14db2 upstream 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 Cc: Johannes Weiner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/serial/dz.c b/drivers/serial/dz.c index 116211fcd36fc..0dddd68b20d27 100644 --- a/drivers/serial/dz.c +++ b/drivers/serial/dz.c @@ -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);