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_rsa: use guard()s

Having all the new guards, use them in the 8250_rsa code. This improves
readability, makes error handling easier, and marks locked portions of
code explicit.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20250814072456.182853-14-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jiri Slaby (SUSE) and committed by
Greg Kroah-Hartman
54faf047 7345b07f

+3 -4
+3 -4
drivers/tty/serial/8250/8250_rsa.c
··· 140 140 return; 141 141 142 142 if (up->port.uartclk != SERIAL_RSA_BAUD_BASE * 16) { 143 - uart_port_lock_irq(&up->port); 143 + guard(uart_port_lock_irq)(&up->port); 144 144 __rsa_enable(up); 145 - uart_port_unlock_irq(&up->port); 146 145 } 147 146 if (up->port.uartclk == SERIAL_RSA_BAUD_BASE * 16) 148 147 serial_out(up, UART_RSA_FRR, 0); ··· 164 165 if (up->port.uartclk != SERIAL_RSA_BAUD_BASE * 16) 165 166 return; 166 167 167 - uart_port_lock_irq(&up->port); 168 + guard(uart_port_lock_irq)(&up->port); 169 + 168 170 mode = serial_in(up, UART_RSA_MSR); 169 171 result = !(mode & UART_RSA_MSR_FIFO); 170 172 ··· 177 177 178 178 if (result) 179 179 up->port.uartclk = SERIAL_RSA_BAUD_BASE_LO * 16; 180 - uart_port_unlock_irq(&up->port); 181 180 } 182 181 EXPORT_SYMBOL_GPL_FOR_MODULES(rsa_disable, "8250_base"); 183 182