]> git.neil.brown.name Git - history.git/commitdiff
[SERIAL] Eliminate a couple of redundant tests
authorRussell King <rmk@flint.arm.linux.org.uk>
Sat, 24 Jan 2004 21:07:44 +0000 (21:07 +0000)
committerRussell King <rmk@flint.arm.linux.org.uk>
Sat, 24 Jan 2004 21:07:44 +0000 (21:07 +0000)
There is no way that tty can be NULL in uart_put_char() and
uart_write().  Eliminate these redundant tests.

drivers/serial/serial_core.c

index 89bc311a28fbe4aab73c2cdf566d3ab38ed2a6d0..c0fbca8849b7776c4804315212936b2605d97a71 100644 (file)
@@ -529,8 +529,7 @@ static void uart_put_char(struct tty_struct *tty, unsigned char ch)
 {
        struct uart_state *state = tty->driver_data;
 
-       if (tty)
-               __uart_put_char(state->port, &state->info->xmit, ch);
+       __uart_put_char(state->port, &state->info->xmit, ch);
 }
 
 static void uart_flush_chars(struct tty_struct *tty)
@@ -545,7 +544,7 @@ uart_write(struct tty_struct *tty, int from_user, const unsigned char * buf,
        struct uart_state *state = tty->driver_data;
        int ret;
 
-       if (!tty || !state->info->xmit.buf)
+       if (!state->info->xmit.buf)
                return 0;
 
        if (from_user)