Skip to content

Commit

Permalink
dz: test after postfix decrement fails in dz_console_putchar()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Roel Kluin authored and Linus Torvalds committed Apr 28, 2008
1 parent 556637c commit 1ecf0d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/serial/dz.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1ecf0d0

Please sign in to comment.