Skip to contentSkip to conversation

staging: dgnc: remove redundant NULL check in

PATCH Superseded Daeseok Youn 2 participants 3 messages May 4, 2016 – May 10, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 staging: dgnc: remove redundant NULL check in

tty and ch are already checked for NULL
before calling dgnc_block_til_ready().

---
 drivers/staging/dgnc/dgnc_tty.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/staging/dgnc/dgnc_tty.c +2 -7
index 2cecdb0..d85d005 100644
@@ -1172,17 +1172,12 @@ static int dgnc_block_til_ready(struct tty_struct *tty,
 				struct channel_t *ch)
 {
 	int retval = 0;
-	struct un_t *un = NULL;
+	struct un_t *un = tty->driver_data;
 	unsigned long flags;
 	uint	old_flags = 0;
 	int	sleep_on_un_flags = 0;
 
-	if (!tty || tty->magic != TTY_MAGIC || !file || !ch ||
-	    ch->magic != DGNC_CHANNEL_MAGIC)
-		return -ENXIO;
-
-	un = tty->driver_data;
-	if (!un || un->magic != DGNC_UNIT_MAGIC)
+	if (!file)
 		return -ENXIO;
 
 	spin_lock_irqsave(&ch->ch_lock, flags);
Signature · 1 line
2.8.2
maintainer
#1 lore raw
Quoted 4 lines · Daeseok Youn

tty and ch are already checked for NULL
before calling dgnc_block_til_ready().

Your subject line doesn't make sense, please fix it up and resend.

thanks,

greg k-h

#2 lore raw

2016-05-09 21:08 GMT+09:00 Greg KH <[email protected]>:

Quoted 7 lines · Daeseok Youn
Quoted 4 lines

tty and ch are already checked for NULL
before calling dgnc_block_til_ready().

Your subject line doesn't make sense, please fix it up and resend.

OK. I will resend this.

thanks

regards,
Daeseok.

Quoted 4 lines

thanks,

greg k-h