Commit e47e7379 authored by Daeseok Youn's avatar Daeseok Youn Committed by Greg Kroah-Hartman

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: default avatarDaeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 16f10a82
...@@ -1536,19 +1536,8 @@ static int dgnc_tty_chars_in_buffer(struct tty_struct *tty) ...@@ -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) static int dgnc_maxcps_room(struct tty_struct *tty, int bytes_available)
{ {
struct channel_t *ch = NULL; struct un_t *un = tty->driver_data;
struct un_t *un = NULL; struct channel_t *ch = un->un_ch;
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;
/* /*
* If its not the Transparent print device, return * If its not the Transparent print device, return
......
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