Skip to contentSkip to conversation

staging: dgnc: remove variable rc

PATCH New Aastha Gupta 1 participant 1 message Sep 16, 2017 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 staging: dgnc: remove variable rc

Found using coccinelle script:
@@
local idexpression ret;
expression e;
@@

-ret =
+return

     e;

-return ret;

---
changes in v3:
-aligned call arguments to nearest preceding tab

 drivers/staging/dgnc/dgnc_neo.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/staging/dgnc/dgnc_neo.c +4 -7
index 1943e66..0ae229c 100644
@@ -1182,7 +1182,6 @@ static int neo_drain(struct tty_struct *tty, uint seconds)
 	unsigned long flags;
 	struct channel_t *ch;
 	struct un_t *un;
-	int rc = 0;
 
 	if (!tty)
 		return -ENXIO;
@@ -1199,12 +1198,10 @@ static int neo_drain(struct tty_struct *tty, uint seconds)
 	un->un_flags |= UN_EMPTY;
 	spin_unlock_irqrestore(&ch->ch_lock, flags);
 
-	rc = wait_event_interruptible_timeout(un->un_flags_wait,
-					      ((un->un_flags & UN_EMPTY) == 0),
-					      msecs_to_jiffies(seconds * 1000));
-
-	/* If ret is non-zero, user ctrl-c'ed us */
-	return rc;
+	/* If returned value is non-zero, user ctrl-c'ed us */
+	return wait_event_interruptible_timeout(un->un_flags_wait,
+					((un->un_flags & UN_EMPTY) == 0),
+					msecs_to_jiffies(seconds * 1000));
 }
 
 /*
Signature · 1 line
2.7.4