linux-stable-rt/drivers/serial
Roel Kluin 52e3632ea6 serial: fix off by one errors
In zs_console_putchar() occurs:

	if (zs_transmit_drain(zport, irq))
		write_zsdata(zport, ch);

However if in zs_transmit_drain() no empty Tx Buffer occurs, limit reaches
-1 => true, and the write still occurs.

This patch changes postfix to prefix decrements in this and similar
functions to prevent similar mistakes in the future.  This decreases the
iterations with one but the chosen loop count was arbitrary anyway.

In sunhv limit reaches -1, not 0, so the test is off by one.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Maciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-06-22 11:32:23 -07:00
..
cpm_uart
jsm
8250.c
8250.h
8250_accent.c
8250_acorn.c
8250_boca.c
8250_early.c
8250_exar_st16c554.c
8250_fourport.c
8250_gsc.c
8250_hp300.c
8250_hub6.c
8250_mca.c
8250_pci.c
8250_pnp.c
21285.c
68328serial.c
68328serial.h
68360serial.c
Kconfig
Makefile
amba-pl010.c
amba-pl011.c
atmel_serial.c
bfin_5xx.c serial: bfin_5xx: fix building as module when early printk is enabled 2009-06-22 11:32:23 -07:00
bfin_sport_uart.c
bfin_sport_uart.h
clps711x.c
crisv10.c
crisv10.h
dz.c
dz.h
icom.c
icom.h
imx.c imx: Check for NULL pointer deref before calling tty_encode_baud_rate 2009-06-16 12:01:17 -07:00
ioc3_serial.c
ioc4_serial.c
ip22zilog.c
ip22zilog.h
kgdboc.c
m32r_sio.c
m32r_sio.h
m32r_sio_reg.h
max3100.c
mcf.c
mpc52xx_uart.c powerpc/5xxx: Add common mpc5xxx_get_bus_frequency() function 2009-06-17 00:30:22 -06:00
mpsc.c
mux.c
netx-serial.c
nwpserial.c
of_serial.c Merge commit 'origin/master' into next 2009-06-18 11:16:55 +10:00
pmac_zilog.c
pmac_zilog.h
pnx8xxx_uart.c
pxa.c
s3c24a0.c
s3c2400.c
s3c2410.c
s3c2412.c
s3c2440.c
s3c6400.c
sa1100.c
samsung.c
samsung.h
sb1250-duart.c serial: fix off by one errors 2009-06-22 11:32:23 -07:00
sc26xx.c
serial_core.c
serial_cs.c
serial_ks8695.c
serial_lh7a40x.c
serial_txx9.c
sh-sci.c
sh-sci.h
sn_console.c
suncore.c
suncore.h
sunhv.c serial: fix off by one errors 2009-06-22 11:32:23 -07:00
sunsab.c
sunsab.h
sunsu.c
sunzilog.c
sunzilog.h
timbuart.c
timbuart.h
uartlite.c
ucc_uart.c
vr41xx_siu.c
zs.c serial: fix off by one errors 2009-06-22 11:32:23 -07:00
zs.h