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: 8250: lcr compute cleanup

* use 'lcr' as variable containing the "computed value" (and not 'cval')
* use 'u8' for the type (and not 'unsigned char')
* drop useless comment

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

authored by

Jiri Slaby (SUSE) and committed by
Greg Kroah-Hartman
59055933 cdc4a3e0

+10 -13
+10 -13
drivers/tty/serial/8250/8250_port.c
··· 2547 2547 return serial8250_do_get_divisor(port, baud, frac); 2548 2548 } 2549 2549 2550 - static unsigned char serial8250_compute_lcr(struct uart_8250_port *up, 2551 - tcflag_t c_cflag) 2550 + static unsigned char serial8250_compute_lcr(struct uart_8250_port *up, tcflag_t c_cflag) 2552 2551 { 2553 - unsigned char cval; 2554 - 2555 - cval = UART_LCR_WLEN(tty_get_char_size(c_cflag)); 2552 + u8 lcr = UART_LCR_WLEN(tty_get_char_size(c_cflag)); 2556 2553 2557 2554 if (c_cflag & CSTOPB) 2558 - cval |= UART_LCR_STOP; 2555 + lcr |= UART_LCR_STOP; 2559 2556 if (c_cflag & PARENB) 2560 - cval |= UART_LCR_PARITY; 2557 + lcr |= UART_LCR_PARITY; 2561 2558 if (!(c_cflag & PARODD)) 2562 - cval |= UART_LCR_EPAR; 2559 + lcr |= UART_LCR_EPAR; 2563 2560 if (c_cflag & CMSPAR) 2564 - cval |= UART_LCR_SPAR; 2561 + lcr |= UART_LCR_SPAR; 2565 2562 2566 - return cval; 2563 + return lcr; 2567 2564 } 2568 2565 2569 2566 void serial8250_do_set_divisor(struct uart_port *port, unsigned int baud, ··· 2818 2821 const struct ktermios *old) 2819 2822 { 2820 2823 struct uart_8250_port *up = up_to_u8250p(port); 2821 - unsigned char cval; 2822 2824 unsigned long flags; 2823 2825 unsigned int baud, quot, frac = 0; 2826 + u8 lcr; 2824 2827 2825 2828 serial8250_set_mini(port, termios); 2826 - cval = serial8250_compute_lcr(up, termios->c_cflag); 2829 + lcr = serial8250_compute_lcr(up, termios->c_cflag); 2827 2830 baud = serial8250_get_baud_rate(port, termios, old); 2828 2831 quot = serial8250_get_divisor(port, baud, &frac); 2829 2832 ··· 2836 2839 serial8250_rpm_get(up); 2837 2840 uart_port_lock_irqsave(port, &flags); 2838 2841 2839 - up->lcr = cval; /* Save computed LCR */ 2842 + up->lcr = lcr; 2840 2843 serial8250_set_trigger_for_slow_speed(port, termios, baud); 2841 2844 serial8250_set_afe(port, termios); 2842 2845 uart_update_timeout(port, termios->c_cflag, baud);