mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-27 22:51:31 +00:00
mxser: cleanup mxser_rs_break
mxser_rs_break 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 <jslaby@suse.cz> Link: https://lore.kernel.org/r/20210618061516.662-56-jslaby@suse.cz Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
987a4cfee5
commit
5990843328
1 changed files with 6 additions and 4 deletions
|
@ -1553,15 +1553,17 @@ static int mxser_rs_break(struct tty_struct *tty, int break_state)
|
||||||
{
|
{
|
||||||
struct mxser_port *info = tty->driver_data;
|
struct mxser_port *info = tty->driver_data;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
u8 lcr;
|
||||||
|
|
||||||
spin_lock_irqsave(&info->slock, flags);
|
spin_lock_irqsave(&info->slock, flags);
|
||||||
|
lcr = inb(info->ioaddr + UART_LCR);
|
||||||
if (break_state == -1)
|
if (break_state == -1)
|
||||||
outb(inb(info->ioaddr + UART_LCR) | UART_LCR_SBC,
|
lcr |= UART_LCR_SBC;
|
||||||
info->ioaddr + UART_LCR);
|
|
||||||
else
|
else
|
||||||
outb(inb(info->ioaddr + UART_LCR) & ~UART_LCR_SBC,
|
lcr &= ~UART_LCR_SBC;
|
||||||
info->ioaddr + UART_LCR);
|
outb(lcr, info->ioaddr + UART_LCR);
|
||||||
spin_unlock_irqrestore(&info->slock, flags);
|
spin_unlock_irqrestore(&info->slock, flags);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue