Commit dc7d3666 authored by Jiri Slaby (SUSE)'s avatar Jiri Slaby (SUSE) Committed by Greg Kroah-Hartman
Browse files

serial: 8250_port: do not use goto for UPQ_NO_TXEN_TEST code flow



This is unnecessary here and makes the code harder to follow. Invert the
condition and drop the goto+label.

Signed-off-by: default avatarJiri Slaby (SUSE) <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20250317070046.24386-30-jirislaby@kernel.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6b879bc9
Loading
Loading
Loading
Loading
+16 −18
Original line number Diff line number Diff line
@@ -2406,12 +2406,10 @@ int serial8250_do_startup(struct uart_port *port)
	 * test if we receive TX irq.  This way, we'll never enable
	 * UART_BUG_TXEN.
	 */
	if (up->port.quirks & UPQ_NO_TXEN_TEST)
		goto dont_test_tx_en;

	if (!(up->port.quirks & UPQ_NO_TXEN_TEST)) {
		/*
	 * Do a quick test to see if we receive an interrupt when we enable
	 * the TX irq.
		 * Do a quick test to see if we receive an interrupt when we
		 * enable the TX irq.
		 */
		serial_port_out(port, UART_IER, UART_IER_THRI);
		lsr = serial_port_in(port, UART_LSR);
@@ -2426,8 +2424,8 @@ int serial8250_do_startup(struct uart_port *port)
		} else {
			up->bugs &= ~UART_BUG_TXEN;
		}
	}

dont_test_tx_en:
	uart_port_unlock_irqrestore(port, flags);

	/*