diff options
author | André Goddard Rosa <andre.goddard@gmail.com> | 2009-10-25 09:18:26 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-12-11 18:18:04 -0500 |
commit | 82cb7ba10deafe17686bf22ce4a7a303a77a197f (patch) | |
tree | 729580b675f6788ede78700339452c8304e939fa /drivers/serial/serial_core.c | |
parent | 9e845abfc8a8973373821aa05302794fd254514b (diff) |
serial: cascade needless conditionals
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/serial/serial_core.c')
-rw-r--r-- | drivers/serial/serial_core.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index 885eabe552c..047530b285b 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c | |||
@@ -342,11 +342,11 @@ uart_get_baud_rate(struct uart_port *port, struct ktermios *termios, | |||
342 | 342 | ||
343 | if (flags == UPF_SPD_HI) | 343 | if (flags == UPF_SPD_HI) |
344 | altbaud = 57600; | 344 | altbaud = 57600; |
345 | if (flags == UPF_SPD_VHI) | 345 | else if (flags == UPF_SPD_VHI) |
346 | altbaud = 115200; | 346 | altbaud = 115200; |
347 | if (flags == UPF_SPD_SHI) | 347 | else if (flags == UPF_SPD_SHI) |
348 | altbaud = 230400; | 348 | altbaud = 230400; |
349 | if (flags == UPF_SPD_WARP) | 349 | else if (flags == UPF_SPD_WARP) |
350 | altbaud = 460800; | 350 | altbaud = 460800; |
351 | 351 | ||
352 | for (try = 0; try < 2; try++) { | 352 | for (try = 0; try < 2; try++) { |
@@ -1217,9 +1217,8 @@ static void uart_set_termios(struct tty_struct *tty, | |||
1217 | /* Handle transition to B0 status */ | 1217 | /* Handle transition to B0 status */ |
1218 | if ((old_termios->c_cflag & CBAUD) && !(cflag & CBAUD)) | 1218 | if ((old_termios->c_cflag & CBAUD) && !(cflag & CBAUD)) |
1219 | uart_clear_mctrl(state->uart_port, TIOCM_RTS | TIOCM_DTR); | 1219 | uart_clear_mctrl(state->uart_port, TIOCM_RTS | TIOCM_DTR); |
1220 | |||
1221 | /* Handle transition away from B0 status */ | 1220 | /* Handle transition away from B0 status */ |
1222 | if (!(old_termios->c_cflag & CBAUD) && (cflag & CBAUD)) { | 1221 | else if (!(old_termios->c_cflag & CBAUD) && (cflag & CBAUD)) { |
1223 | unsigned int mask = TIOCM_DTR; | 1222 | unsigned int mask = TIOCM_DTR; |
1224 | if (!(cflag & CRTSCTS) || | 1223 | if (!(cflag & CRTSCTS) || |
1225 | !test_bit(TTY_THROTTLED, &tty->flags)) | 1224 | !test_bit(TTY_THROTTLED, &tty->flags)) |
@@ -1234,9 +1233,8 @@ static void uart_set_termios(struct tty_struct *tty, | |||
1234 | __uart_start(tty); | 1233 | __uart_start(tty); |
1235 | spin_unlock_irqrestore(&state->uart_port->lock, flags); | 1234 | spin_unlock_irqrestore(&state->uart_port->lock, flags); |
1236 | } | 1235 | } |
1237 | |||
1238 | /* Handle turning on CRTSCTS */ | 1236 | /* Handle turning on CRTSCTS */ |
1239 | if (!(old_termios->c_cflag & CRTSCTS) && (cflag & CRTSCTS)) { | 1237 | else if (!(old_termios->c_cflag & CRTSCTS) && (cflag & CRTSCTS)) { |
1240 | spin_lock_irqsave(&state->uart_port->lock, flags); | 1238 | spin_lock_irqsave(&state->uart_port->lock, flags); |
1241 | if (!(state->uart_port->ops->get_mctrl(state->uart_port) & TIOCM_CTS)) { | 1239 | if (!(state->uart_port->ops->get_mctrl(state->uart_port) & TIOCM_CTS)) { |
1242 | tty->hw_stopped = 1; | 1240 | tty->hw_stopped = 1; |