Browse Source

dz: test after postfix decrement fails in dz_console_putchar()

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>
Roel Kluin 17 years ago
parent
commit
1ecf0d0cd2
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/serial/dz.c

+ 1 - 1
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);
 		dz_out(dport, DZ_TCR, mask);
 		iob();
 		iob();
 		udelay(2);
 		udelay(2);
-	} while (loops--);
+	} while (--loops);
 
 
 	if (loops)				/* Cannot send otherwise. */
 	if (loops)				/* Cannot send otherwise. */
 		dz_out(dport, DZ_TDR, ch);
 		dz_out(dport, DZ_TDR, ch);