[30/37] dz: test after postfix decrement fails indz_console_putchar()

From: Greg KH
Date: Tue Apr 29 2008 - 13:32:32 EST


2.6.25-stable review patch. If anyone has any objections, please let us
know.

------------------
From: Roel Kluin <12o3l@xxxxxxxxxx>

commit 1ecf0d0cd28a4bfed3009f752061998e52d14db2 upstream

When loops reaches 0 the postfix decrement still subtracts, so the subsequent
test fails.

Signed-off-by: Roel Kluin <12o3l@xxxxxxxxxx>
Acked-by: Maciej W. Rozycki <macro@xxxxxxxxxxxxxx>
Cc: Johannes Weiner <hannes@xxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

---
drivers/serial/dz.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/serial/dz.c
+++ b/drivers/serial/dz.c
@@ -819,7 +819,7 @@ static void dz_console_putchar(struct ua
dz_out(dport, DZ_TCR, mask);
iob();
udelay(2);
- } while (loops--);
+ } while (--loops);

if (loops) /* Cannot send otherwise. */
dz_out(dport, DZ_TDR, ch);

--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/