tty: Use termios c_*flag macros
Expressions of the form "tty->termios.c_*flag & FLAG" are more clearly expressed with the termios flags macros, I_FLAG(), C_FLAG(), O_FLAG(), and L_FLAG(). Convert treewide. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Acked-by: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
5823323ea5
commit
9db276f8f0
@@ -2363,7 +2363,7 @@ static void mgsl_throttle(struct tty_struct * tty)
|
||||
if (I_IXOFF(tty))
|
||||
mgsl_send_xchar(tty, STOP_CHAR(tty));
|
||||
|
||||
if (tty->termios.c_cflag & CRTSCTS) {
|
||||
if (C_CRTSCTS(tty)) {
|
||||
spin_lock_irqsave(&info->irq_spinlock,flags);
|
||||
info->serial_signals &= ~SerialSignal_RTS;
|
||||
usc_set_serial_signals(info);
|
||||
@@ -2397,7 +2397,7 @@ static void mgsl_unthrottle(struct tty_struct * tty)
|
||||
mgsl_send_xchar(tty, START_CHAR(tty));
|
||||
}
|
||||
|
||||
if (tty->termios.c_cflag & CRTSCTS) {
|
||||
if (C_CRTSCTS(tty)) {
|
||||
spin_lock_irqsave(&info->irq_spinlock,flags);
|
||||
info->serial_signals |= SerialSignal_RTS;
|
||||
usc_set_serial_signals(info);
|
||||
@@ -3039,30 +3039,25 @@ static void mgsl_set_termios(struct tty_struct *tty, struct ktermios *old_termio
|
||||
mgsl_change_params(info);
|
||||
|
||||
/* Handle transition to B0 status */
|
||||
if (old_termios->c_cflag & CBAUD &&
|
||||
!(tty->termios.c_cflag & CBAUD)) {
|
||||
if ((old_termios->c_cflag & CBAUD) && !C_BAUD(tty)) {
|
||||
info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR);
|
||||
spin_lock_irqsave(&info->irq_spinlock,flags);
|
||||
usc_set_serial_signals(info);
|
||||
spin_unlock_irqrestore(&info->irq_spinlock,flags);
|
||||
}
|
||||
|
||||
|
||||
/* Handle transition away from B0 status */
|
||||
if (!(old_termios->c_cflag & CBAUD) &&
|
||||
tty->termios.c_cflag & CBAUD) {
|
||||
if (!(old_termios->c_cflag & CBAUD) && C_BAUD(tty)) {
|
||||
info->serial_signals |= SerialSignal_DTR;
|
||||
if (!(tty->termios.c_cflag & CRTSCTS) ||
|
||||
!test_bit(TTY_THROTTLED, &tty->flags)) {
|
||||
if (!C_CRTSCTS(tty) || !test_bit(TTY_THROTTLED, &tty->flags))
|
||||
info->serial_signals |= SerialSignal_RTS;
|
||||
}
|
||||
spin_lock_irqsave(&info->irq_spinlock,flags);
|
||||
usc_set_serial_signals(info);
|
||||
spin_unlock_irqrestore(&info->irq_spinlock,flags);
|
||||
}
|
||||
|
||||
|
||||
/* Handle turning off CRTSCTS */
|
||||
if (old_termios->c_cflag & CRTSCTS &&
|
||||
!(tty->termios.c_cflag & CRTSCTS)) {
|
||||
if (old_termios->c_cflag & CRTSCTS && !C_CRTSCTS(tty)) {
|
||||
tty->hw_stopped = 0;
|
||||
mgsl_start(tty);
|
||||
}
|
||||
@@ -3281,7 +3276,7 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (tty->termios.c_cflag & CLOCAL)
|
||||
if (C_CLOCAL(tty))
|
||||
do_clocal = true;
|
||||
|
||||
/* Wait for carrier detect and the line to become
|
||||
|
Reference in New Issue
Block a user