Skip to contentSkip to conversation

tty_ldisc: remove unnecessary negative return check for wait_event_timeout

PATCH In review Dave Young 2 participants 2 messages Nov 8, 2011 TTY layer and serial drivers

lore
Share & tools
lore

Dave Young

author
#0 lore raw

PATCH 1/1 tty_ldisc: remove unnecessary negative return check for wait_event_timeout

wait_event_timeout always return value >= 0
remove the unnecessary ret < 0 check

---
 drivers/tty/tty_ldisc.c |    2 --
 1 file changed, 2 deletions(-)
drivers/tty/tty_ldisc.c +0 -2
@@ -556,8 +556,6 @@ static int tty_ldisc_wait_idle(struct tt
 	int ret;
 	ret = wait_event_timeout(tty_ldisc_idle,
 			atomic_read(&tty->ldisc->users) == 1, 5 * HZ);
-	if (ret < 0)
-		return ret;
 	return ret > 0 ? 0 : -EBUSY;
 }
 
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Dave Young

wait_event_timeout always return value >= 0
remove the unnecessary ret < 0 check

This is a hangover from times when there was _interruptible.

Quoted 15 lines
---
 drivers/tty/tty_ldisc.c |    2 --
 1 file changed, 2 deletions(-)
drivers/tty/tty_ldisc.c +0 -2
@@ -556,8 +556,6 @@ static int tty_ldisc_wait_idle(struct tt
 	int ret;
 	ret = wait_event_timeout(tty_ldisc_idle,
 			atomic_read(&tty->ldisc->users) == 1, 5 * HZ);
-	if (ret < 0)
-		return ret;
 	return ret > 0 ? 0 : -EBUSY;
 }
 
Signature · 2 lines
js
suse labs