linux_dsm_epyc7002/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 cpm_uart: Disable CPM udbg when re-initing CPM uart, even if not the console. 2009-04-06 09:09:33 -05:00
jsm jsm: correctly support multiple 4/8-port boards 2009-06-11 08:51:02 -07:00
8250_accent.c
8250_acorn.c
8250_boca.c
8250_early.c
8250_exar_st16c554.c
8250_fourport.c
8250_gsc.c serial: 8250_gsc: fix printk format error 2009-05-29 08:40:02 -07:00
8250_hp300.c
8250_hub6.c
8250_mca.c
8250_pci.c 8250_pci: add the OXCB950 chip to the 8250 PCI driver. 2009-06-11 08:50:58 -07:00
8250_pnp.c serial: Update PNP IDs 2009-04-06 14:36:26 -07:00
8250.c serial: add support for the TI AR7 internal UART 2009-06-11 08:51:03 -07:00
8250.h 8250: improve workaround for UARTs that don't re-assert THRE correctly 2008-09-02 19:21:38 -07:00
21285.c [ARM] acorn,ebsa110,footbridge,integrator,sa1100: Convert asm/io.h to linux/io.h 2009-03-25 10:21:35 +00:00
68328serial.c serial, 8250: remove NR_IRQ usage 2008-10-16 16:52:02 +02:00
68328serial.h
68360serial.c
amba-pl010.c [ARM] 5544/1: Trust PrimeCell resource sizes 2009-06-11 15:36:56 +01:00
amba-pl011.c [ARM] 5544/1: Trust PrimeCell resource sizes 2009-06-11 15:36:56 +01:00
atmel_serial.c atmel_serial: fix hang in set_termios when crtscts is enabled 2009-06-16 12:01:16 -07:00
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 Blackfin SPORT UART: rewrite inline assembly 2009-06-11 08:51:04 -07:00
bfin_sport_uart.h
clps711x.c [ARM] acorn,ebsa110,footbridge,integrator,sa1100: Convert asm/io.h to linux/io.h 2009-03-25 10:21:35 +00:00
crisv10.c CRISv10: fix serial driver proc-usage 2009-05-02 15:36:09 -07:00
crisv10.h tty: Use the generic RS485 ioctl on CRIS 2009-04-07 08:44:05 -07:00
dz.c serial: DZ11: avoid a hang at console switch-over 2008-07-24 10:47:29 -07:00
dz.h
icom.c icom: fix compile errors when defining ICOM_TRACE 2009-06-11 08:51:03 -07:00
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 [IA64] Fix section mismatch ioc3uart_init()/ioc3uart_submodule 2008-12-09 10:08:51 -08:00
ioc4_serial.c
ip22zilog.c
ip22zilog.h
Kconfig trivial: Kconfig: .ko is normally not included in module names 2009-06-12 18:01:50 +02:00
kgdboc.c
m32r_sio_reg.h
m32r_sio.c drivers/serial: use nr_irqs 2008-10-16 16:52:06 +02:00
m32r_sio.h
Makefile serial: Added Timberdale UART driver 2009-06-11 08:51:06 -07:00
max3100.c tty: MAX3100 2009-04-08 14:33:38 -07:00
mcf.c m68knommu: Fix support for console port other than ttyS0 on mcf.c 2009-03-24 15:17:43 +10:00
mpc52xx_uart.c powerpc/5xxx: Add common mpc5xxx_get_bus_frequency() function 2009-06-17 00:30:22 -06:00
mpsc.c kgdb: kgdboc console poll hooks for mpsc uart 2008-07-23 11:30:16 -05:00
mux.c
netx-serial.c [ARM] build fixes for netX serial driver 2008-10-30 09:41:59 +01:00
nwpserial.c serial/nwpserial: Fix wrong register read address and add interrupt acknowledge. 2009-05-15 16:43:42 +10:00
of_serial.c Merge commit 'origin/master' into next 2009-06-18 11:16:55 +10:00
pmac_zilog.c powerpc/pmac: Fix internal modem IRQ on Wallstreet PowerBook 2009-04-07 15:07:43 +10:00
pmac_zilog.h
pnx8xxx_uart.c When a break signal is detected, the next character should be ignored. 2009-01-15 12:48:36 -08:00
pxa.c [ARM] pxa: remove machine class specific stuffs from serial driver 2009-03-09 21:22:38 +08:00
s3c24a0.c [ARM] S3C24A0: Serial port definitions and driver support. 2008-12-15 21:46:36 +00:00
s3c2400.c [ARM] S3C24XX: Move files out of include/asm-arm/plat-s3c* 2008-10-07 22:26:09 +01:00
s3c2410.c [ARM] S3C24XX: Move files out of include/asm-arm/plat-s3c* 2008-10-07 22:26:09 +01:00
s3c2412.c [ARM] S3C24XX: Move files out of include/asm-arm/plat-s3c* 2008-10-07 22:26:09 +01:00
s3c2440.c drivers/serial/s3c2440.c: fix typo in MODULE_LICENSE 2008-12-10 08:01:53 -08:00
s3c6400.c [ARM] S3C: Add UDIVSLOT support for newer UARTS 2009-05-01 12:28:16 +01:00
sa1100.c [ARM] acorn,ebsa110,footbridge,integrator,sa1100: Convert asm/io.h to linux/io.h 2009-03-25 10:21:35 +00:00
samsung.c [ARM] S3C: Add UDIVSLOT support for newer UARTS 2009-05-01 12:28:16 +01:00
samsung.h [ARM] S3C: Add UDIVSLOT support for newer UARTS 2009-05-01 12:28:16 +01:00
sb1250-duart.c serial: fix off by one errors 2009-06-22 11:32:23 -07:00
sc26xx.c
serial_core.c serial: fixup /proc/tty/driver/serial after proc_fops conversion 2009-04-01 14:50:48 -07:00
serial_cs.c 3c589_cs: add cis(firmware) of 3Com multifunction pcmcia card 2009-05-01 19:21:26 -07:00
serial_ks8695.c [ARM] 5250/1: unbalanced enable_irq() for serial_ks8695.c fix 2008-10-01 22:41:43 +01:00
serial_lh7a40x.c [ARM] lh7a40x: avoid polluting the kernel's namespace 2008-11-28 16:39:04 +00:00
serial_txx9.c serial_txx9: use %lx for iobase 2008-10-20 08:50:24 -07:00
sh-sci.c serial: sh-sci: Move over to dev_pm_ops. 2009-06-15 07:07:38 +09:00
sh-sci.h sh: Fix up the sh64 earlyprintk build. 2009-05-09 14:31:37 +09:00
sn_console.c Altix serial: fix 2008-10-20 08:52:36 -07:00
suncore.c
suncore.h
sunhv.c serial: fix off by one errors 2009-06-22 11:32:23 -07:00
sunsab.c sparc: Annotate of_device_id arrays with const or __initdata. 2008-08-31 01:23:17 -07:00
sunsab.h
sunsu.c serial: sunsu: sunsu_kbd_ms_init needs to be __devinit 2009-04-08 03:29:03 -07:00
sunzilog.c serial: struct device - replace bus_id with dev_name(), dev_set_name() 2009-03-24 16:38:21 -07:00
sunzilog.h
timbuart.c timbuart: Fix the termios logic 2009-06-11 08:51:06 -07:00
timbuart.h serial: Added Timberdale UART driver 2009-06-11 08:51:06 -07:00
uartlite.c powerpc/virtex: fix various format/casting printk mismatches 2008-11-14 09:59:48 -07:00
ucc_uart.c serial: Make ucc_uart work in HW UART mode 2009-06-15 21:45:31 -05:00
vr41xx_siu.c
zs.c serial: fix off by one errors 2009-06-22 11:32:23 -07:00
zs.h