Commit 035173c9 authored by Ilpo Järvinen's avatar Ilpo Järvinen Committed by Greg Kroah-Hartman

tty: Convert hw_stopped in tty_struct to bool

hw_stopped in tty_struct is used like bool, convert the variable type
to bool.
Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org> # For MMC
Link: https://lore.kernel.org/r/20230309082035.14880-9-ilpo.jarvinen@linux.intel.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 37e8b08a
...@@ -1060,7 +1060,7 @@ static void cts_change(MGSLPC_INFO *info, struct tty_struct *tty) ...@@ -1060,7 +1060,7 @@ static void cts_change(MGSLPC_INFO *info, struct tty_struct *tty)
if (info->serial_signals & SerialSignal_CTS) { if (info->serial_signals & SerialSignal_CTS) {
if (debug_level >= DEBUG_LEVEL_ISR) if (debug_level >= DEBUG_LEVEL_ISR)
printk("CTS tx start..."); printk("CTS tx start...");
tty->hw_stopped = 0; tty->hw_stopped = false;
tx_start(info, tty); tx_start(info, tty);
info->pending_bh |= BH_TRANSMIT; info->pending_bh |= BH_TRANSMIT;
return; return;
...@@ -1069,7 +1069,7 @@ static void cts_change(MGSLPC_INFO *info, struct tty_struct *tty) ...@@ -1069,7 +1069,7 @@ static void cts_change(MGSLPC_INFO *info, struct tty_struct *tty)
if (!(info->serial_signals & SerialSignal_CTS)) { if (!(info->serial_signals & SerialSignal_CTS)) {
if (debug_level >= DEBUG_LEVEL_ISR) if (debug_level >= DEBUG_LEVEL_ISR)
printk("CTS tx stop..."); printk("CTS tx stop...");
tty->hw_stopped = 1; tty->hw_stopped = true;
tx_stop(info); tx_stop(info);
} }
} }
...@@ -2312,7 +2312,7 @@ static void mgslpc_set_termios(struct tty_struct *tty, ...@@ -2312,7 +2312,7 @@ static void mgslpc_set_termios(struct tty_struct *tty,
/* Handle turning off CRTSCTS */ /* Handle turning off CRTSCTS */
if (old_termios->c_cflag & CRTSCTS && !C_CRTSCTS(tty)) { if (old_termios->c_cflag & CRTSCTS && !C_CRTSCTS(tty)) {
tty->hw_stopped = 0; tty->hw_stopped = false;
tx_release(tty); tx_release(tty);
} }
} }
......
...@@ -478,13 +478,13 @@ static void sdio_uart_check_modem_status(struct sdio_uart_port *port) ...@@ -478,13 +478,13 @@ static void sdio_uart_check_modem_status(struct sdio_uart_port *port)
int cts = (status & UART_MSR_CTS); int cts = (status & UART_MSR_CTS);
if (tty->hw_stopped) { if (tty->hw_stopped) {
if (cts) { if (cts) {
tty->hw_stopped = 0; tty->hw_stopped = false;
sdio_uart_start_tx(port); sdio_uart_start_tx(port);
tty_wakeup(tty); tty_wakeup(tty);
} }
} else { } else {
if (!cts) { if (!cts) {
tty->hw_stopped = 1; tty->hw_stopped = true;
sdio_uart_stop_tx(port); sdio_uart_stop_tx(port);
} }
} }
...@@ -633,7 +633,7 @@ static int sdio_uart_activate(struct tty_port *tport, struct tty_struct *tty) ...@@ -633,7 +633,7 @@ static int sdio_uart_activate(struct tty_port *tport, struct tty_struct *tty)
if (C_CRTSCTS(tty)) if (C_CRTSCTS(tty))
if (!(sdio_uart_get_mctrl(port) & TIOCM_CTS)) if (!(sdio_uart_get_mctrl(port) & TIOCM_CTS))
tty->hw_stopped = 1; tty->hw_stopped = true;
clear_bit(TTY_IO_ERROR, &tty->flags); clear_bit(TTY_IO_ERROR, &tty->flags);
...@@ -882,14 +882,14 @@ static void sdio_uart_set_termios(struct tty_struct *tty, ...@@ -882,14 +882,14 @@ static void sdio_uart_set_termios(struct tty_struct *tty,
/* Handle turning off CRTSCTS */ /* Handle turning off CRTSCTS */
if ((old_termios->c_cflag & CRTSCTS) && !(cflag & CRTSCTS)) { if ((old_termios->c_cflag & CRTSCTS) && !(cflag & CRTSCTS)) {
tty->hw_stopped = 0; tty->hw_stopped = false;
sdio_uart_start_tx(port); sdio_uart_start_tx(port);
} }
/* Handle turning on CRTSCTS */ /* Handle turning on CRTSCTS */
if (!(old_termios->c_cflag & CRTSCTS) && (cflag & CRTSCTS)) { if (!(old_termios->c_cflag & CRTSCTS) && (cflag & CRTSCTS)) {
if (!(sdio_uart_get_mctrl(port) & TIOCM_CTS)) { if (!(sdio_uart_get_mctrl(port) & TIOCM_CTS)) {
tty->hw_stopped = 1; tty->hw_stopped = true;
sdio_uart_stop_tx(port); sdio_uart_stop_tx(port);
} }
} }
......
...@@ -347,7 +347,7 @@ static void check_modem_status(struct serial_state *info) ...@@ -347,7 +347,7 @@ static void check_modem_status(struct serial_state *info)
#if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW)) #if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW))
printk("CTS tx start..."); printk("CTS tx start...");
#endif #endif
port->tty->hw_stopped = 0; port->tty->hw_stopped = false;
info->IER |= UART_IER_THRI; info->IER |= UART_IER_THRI;
amiga_custom.intena = IF_SETCLR | IF_TBE; amiga_custom.intena = IF_SETCLR | IF_TBE;
mb(); mb();
...@@ -362,7 +362,7 @@ static void check_modem_status(struct serial_state *info) ...@@ -362,7 +362,7 @@ static void check_modem_status(struct serial_state *info)
#if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW)) #if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW))
printk("CTS tx stop..."); printk("CTS tx stop...");
#endif #endif
port->tty->hw_stopped = 1; port->tty->hw_stopped = true;
info->IER &= ~UART_IER_THRI; info->IER &= ~UART_IER_THRI;
/* disable Tx interrupt and remove any pending interrupts */ /* disable Tx interrupt and remove any pending interrupts */
amiga_custom.intena = IF_TBE; amiga_custom.intena = IF_TBE;
...@@ -1197,7 +1197,7 @@ static void rs_set_termios(struct tty_struct *tty, const struct ktermios *old_te ...@@ -1197,7 +1197,7 @@ static void rs_set_termios(struct tty_struct *tty, const struct ktermios *old_te
/* Handle turning off CRTSCTS */ /* Handle turning off CRTSCTS */
if ((old_termios->c_cflag & CRTSCTS) && !C_CRTSCTS(tty)) { if ((old_termios->c_cflag & CRTSCTS) && !C_CRTSCTS(tty)) {
tty->hw_stopped = 0; tty->hw_stopped = false;
rs_start(tty); rs_start(tty);
} }
......
...@@ -553,7 +553,7 @@ static void mxser_handle_cts(struct tty_struct *tty, struct mxser_port *info, ...@@ -553,7 +553,7 @@ static void mxser_handle_cts(struct tty_struct *tty, struct mxser_port *info,
if (tty->hw_stopped) { if (tty->hw_stopped) {
if (cts) { if (cts) {
tty->hw_stopped = 0; tty->hw_stopped = false;
if (!mxser_16550A_or_MUST(info)) if (!mxser_16550A_or_MUST(info))
__mxser_start_tx(info); __mxser_start_tx(info);
...@@ -563,7 +563,7 @@ static void mxser_handle_cts(struct tty_struct *tty, struct mxser_port *info, ...@@ -563,7 +563,7 @@ static void mxser_handle_cts(struct tty_struct *tty, struct mxser_port *info,
} else if (cts) } else if (cts)
return; return;
tty->hw_stopped = 1; tty->hw_stopped = true;
if (!mxser_16550A_or_MUST(info)) if (!mxser_16550A_or_MUST(info))
__mxser_stop_tx(info); __mxser_stop_tx(info);
} }
...@@ -1361,7 +1361,7 @@ static void mxser_set_termios(struct tty_struct *tty, ...@@ -1361,7 +1361,7 @@ static void mxser_set_termios(struct tty_struct *tty,
spin_unlock_irqrestore(&info->slock, flags); spin_unlock_irqrestore(&info->slock, flags);
if ((old_termios->c_cflag & CRTSCTS) && !C_CRTSCTS(tty)) { if ((old_termios->c_cflag & CRTSCTS) && !C_CRTSCTS(tty)) {
tty->hw_stopped = 0; tty->hw_stopped = false;
mxser_start(tty); mxser_start(tty);
} }
......
...@@ -730,7 +730,7 @@ static void set_termios(struct tty_struct *tty, ...@@ -730,7 +730,7 @@ static void set_termios(struct tty_struct *tty,
/* Handle turning off CRTSCTS */ /* Handle turning off CRTSCTS */
if ((old_termios->c_cflag & CRTSCTS) && !C_CRTSCTS(tty)) { if ((old_termios->c_cflag & CRTSCTS) && !C_CRTSCTS(tty)) {
tty->hw_stopped = 0; tty->hw_stopped = false;
tx_release(tty); tx_release(tty);
} }
} }
...@@ -1953,13 +1953,13 @@ static void cts_change(struct slgt_info *info, unsigned short status) ...@@ -1953,13 +1953,13 @@ static void cts_change(struct slgt_info *info, unsigned short status)
if (info->port.tty) { if (info->port.tty) {
if (info->port.tty->hw_stopped) { if (info->port.tty->hw_stopped) {
if (info->signals & SerialSignal_CTS) { if (info->signals & SerialSignal_CTS) {
info->port.tty->hw_stopped = 0; info->port.tty->hw_stopped = false;
info->pending_bh |= BH_TRANSMIT; info->pending_bh |= BH_TRANSMIT;
return; return;
} }
} else { } else {
if (!(info->signals & SerialSignal_CTS)) if (!(info->signals & SerialSignal_CTS))
info->port.tty->hw_stopped = 1; info->port.tty->hw_stopped = true;
} }
} }
} }
......
...@@ -227,7 +227,7 @@ struct tty_struct { ...@@ -227,7 +227,7 @@ struct tty_struct {
unsigned long unused[0]; unsigned long unused[0];
} __aligned(sizeof(unsigned long)) ctrl; } __aligned(sizeof(unsigned long)) ctrl;
int hw_stopped; bool hw_stopped;
unsigned int receive_room; unsigned int receive_room;
int flow_change; int flow_change;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment