Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

serial: Convert SERIAL_XMIT_SIZE to UART_XMIT_SIZE

Both UART_XMIT_SIZE and SERIAL_XMIT_SIZE are defined. Make them all
UART_XMIT_SIZE.

Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20220624205424.12686-6-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Ilpo Järvinen and committed by
Greg Kroah-Hartman
eb47b59a 27a1c392

+13 -19
+9 -9
drivers/tty/amiserial.c
··· 51 51 #include <linux/seq_file.h> 52 52 #include <linux/serial.h> 53 53 #include <linux/serial_reg.h> 54 + #include <linux/serial_core.h> 54 55 #include <linux/sched.h> 55 56 #include <linux/signal.h> 56 57 #include <linux/slab.h> ··· 284 283 285 284 amiga_custom.serdat = info->xmit.buf[info->xmit.tail++] | 0x100; 286 285 mb(); 287 - info->xmit.tail = info->xmit.tail & (SERIAL_XMIT_SIZE-1); 286 + info->xmit.tail = info->xmit.tail & (UART_XMIT_SIZE - 1); 288 287 info->icount.tx++; 289 288 290 289 if (CIRC_CNT(info->xmit.head, 291 290 info->xmit.tail, 292 - SERIAL_XMIT_SIZE) < WAKEUP_CHARS) 291 + UART_XMIT_SIZE) < WAKEUP_CHARS) 293 292 tty_wakeup(info->tport.tty); 294 293 295 294 #ifdef SERIAL_DEBUG_INTR ··· 709 708 local_irq_save(flags); 710 709 if (CIRC_SPACE(info->xmit.head, 711 710 info->xmit.tail, 712 - SERIAL_XMIT_SIZE) == 0) { 711 + UART_XMIT_SIZE) == 0) { 713 712 local_irq_restore(flags); 714 713 return 0; 715 714 } 716 715 717 716 info->xmit.buf[info->xmit.head++] = ch; 718 - info->xmit.head &= SERIAL_XMIT_SIZE-1; 717 + info->xmit.head &= UART_XMIT_SIZE - 1; 719 718 local_irq_restore(flags); 720 719 return 1; 721 720 } ··· 754 753 while (1) { 755 754 c = CIRC_SPACE_TO_END(info->xmit.head, 756 755 info->xmit.tail, 757 - SERIAL_XMIT_SIZE); 756 + UART_XMIT_SIZE); 758 757 if (count < c) 759 758 c = count; 760 759 if (c <= 0) { 761 760 break; 762 761 } 763 762 memcpy(info->xmit.buf + info->xmit.head, buf, c); 764 - info->xmit.head = ((info->xmit.head + c) & 765 - (SERIAL_XMIT_SIZE-1)); 763 + info->xmit.head = (info->xmit.head + c) & (UART_XMIT_SIZE - 1); 766 764 buf += c; 767 765 count -= c; 768 766 ret += c; ··· 788 788 { 789 789 struct serial_state *info = tty->driver_data; 790 790 791 - return CIRC_SPACE(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE); 791 + return CIRC_SPACE(info->xmit.head, info->xmit.tail, UART_XMIT_SIZE); 792 792 } 793 793 794 794 static unsigned int rs_chars_in_buffer(struct tty_struct *tty) 795 795 { 796 796 struct serial_state *info = tty->driver_data; 797 797 798 - return CIRC_CNT(info->xmit.head, info->xmit.tail, SERIAL_XMIT_SIZE); 798 + return CIRC_CNT(info->xmit.head, info->xmit.tail, UART_XMIT_SIZE); 799 799 } 800 800 801 801 static void rs_flush_buffer(struct tty_struct *tty)
+1 -1
drivers/tty/mips_ejtag_fdc.c
··· 916 916 mips_ejtag_fdc_write(priv, REG_FDCFG, cfg); 917 917 918 918 /* Make each port's xmit FIFO big enough to fill FDC TX FIFO */ 919 - priv->xmit_size = min(tx_fifo * 4, (unsigned int)SERIAL_XMIT_SIZE); 919 + priv->xmit_size = min(tx_fifo * 4, (unsigned int)UART_XMIT_SIZE); 920 920 921 921 driver = tty_alloc_driver(NUM_TTY_CHANNELS, TTY_DRIVER_REAL_RAW); 922 922 if (IS_ERR(driver))
+1 -1
drivers/tty/serial/meson_uart.c
··· 162 162 163 163 ch = xmit->buf[xmit->tail]; 164 164 writel(ch, port->membase + AML_UART_WFIFO); 165 - xmit->tail = (xmit->tail+1) & (SERIAL_XMIT_SIZE - 1); 165 + xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); 166 166 port->icount.tx++; 167 167 } 168 168
+1 -1
drivers/tty/serial/owl-uart.c
··· 201 201 202 202 ch = xmit->buf[xmit->tail]; 203 203 owl_uart_write(port, ch, OWL_UART_TXDAT); 204 - xmit->tail = (xmit->tail + 1) & (SERIAL_XMIT_SIZE - 1); 204 + xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); 205 205 port->icount.tx++; 206 206 } 207 207
+1 -1
drivers/tty/serial/rda-uart.c
··· 353 353 354 354 ch = xmit->buf[xmit->tail]; 355 355 rda_uart_write(port, ch, RDA_UART_RXTX_BUFFER); 356 - xmit->tail = (xmit->tail + 1) & (SERIAL_XMIT_SIZE - 1); 356 + xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); 357 357 port->icount.tx++; 358 358 } 359 359
-6
include/linux/serial.h
··· 9 9 #ifndef _LINUX_SERIAL_H 10 10 #define _LINUX_SERIAL_H 11 11 12 - #include <asm/page.h> 13 12 #include <uapi/linux/serial.h> 14 13 15 14 /* Helper for dealing with UART_LCR_WLEN* defines */ ··· 23 24 __u32 frame, parity, overrun, brk; 24 25 __u32 buf_overrun; 25 26 }; 26 - 27 - /* 28 - * The size of the serial xmit buffer is 1 page, or 4096 bytes 29 - */ 30 - #define SERIAL_XMIT_SIZE PAGE_SIZE 31 27 32 28 #include <linux/compiler.h> 33 29