From 007bbdc87522d17d711ca6bef0d4fe85f62f8c84 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Fri, 18 Jun 2021 08:15:02 +0200 Subject: mxser: cleanup mxser_dtr_rts mxser_dtr_rts now does all inb, outb, & or | in a single statement. The code is hard to follow, so make it more readable by doing one-line = one-statement. Signed-off-by: Jiri Slaby Link: https://lore.kernel.org/r/20210618061516.662-57-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman --- drivers/tty/mxser.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'drivers/tty/mxser.c') diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c index 5789c4343f10..daf820c086f4 100644 --- a/drivers/tty/mxser.c +++ b/drivers/tty/mxser.c @@ -428,14 +428,15 @@ static void mxser_dtr_rts(struct tty_port *port, int on) { struct mxser_port *mp = container_of(port, struct mxser_port, port); unsigned long flags; + u8 mcr; spin_lock_irqsave(&mp->slock, flags); + mcr = inb(mp->ioaddr + UART_MCR); if (on) - outb(inb(mp->ioaddr + UART_MCR) | - UART_MCR_DTR | UART_MCR_RTS, mp->ioaddr + UART_MCR); + mcr |= UART_MCR_DTR | UART_MCR_RTS; else - outb(inb(mp->ioaddr + UART_MCR)&~(UART_MCR_DTR | UART_MCR_RTS), - mp->ioaddr + UART_MCR); + mcr &= ~(UART_MCR_DTR | UART_MCR_RTS); + outb(mcr, mp->ioaddr + UART_MCR); spin_unlock_irqrestore(&mp->slock, flags); } -- cgit v1.2.3-58-ga151