diff options
author | Daeseok Youn <daeseok.youn@gmail.com> | 2016-04-05 09:30:02 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-04-30 00:46:00 (GMT) |
commit | e47e7379ce3e03018619e994976b4059b790c955 (patch) | |
tree | 7555cc4dcbb47d46a6c161a42b8235030dbdd02a /drivers | |
parent | 16f10a825da5b9361ef8e8da76720c37f0116da4 (diff) | |
download | linux-e47e7379ce3e03018619e994976b4059b790c955.tar.xz |
staging: dgnc: remove redundant NULL check in
There were already checking NULL about channel_t / un_t
before calling dgnc_maxcps_room().
Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/dgnc/dgnc_tty.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c index 7f73a41..c07897a 100644 --- a/drivers/staging/dgnc/dgnc_tty.c +++ b/drivers/staging/dgnc/dgnc_tty.c @@ -1536,19 +1536,8 @@ static int dgnc_tty_chars_in_buffer(struct tty_struct *tty) */ static int dgnc_maxcps_room(struct tty_struct *tty, int bytes_available) { - struct channel_t *ch = NULL; - struct un_t *un = NULL; - - if (!tty) - return bytes_available; - - un = tty->driver_data; - if (!un || un->magic != DGNC_UNIT_MAGIC) - return bytes_available; - - ch = un->un_ch; - if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) - return bytes_available; + struct un_t *un = tty->driver_data; + struct channel_t *ch = un->un_ch; /* * If its not the Transparent print device, return |