]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
staging: dgnc: remove variable rc
authorAastha Gupta <aastha.gupta4104@gmail.com>
Sat, 16 Sep 2017 13:59:33 +0000 (19:29 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 18 Sep 2017 09:45:25 +0000 (11:45 +0200)
Found using coccinelle script:
@@
local idexpression ret;
expression e;
@@

-ret =
+return
     e;
-return ret;

Signed-off-by: Aastha Gupta <aastha.gupta4104@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/dgnc/dgnc_neo.c

index 1943e66fec571c16dea14e5f890a3de41218ec06..0ae229c3aaaad84f5721aeeb2056f0147f97414c 100644 (file)
@@ -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));
 }
 
 /*