Staging: dgnc: Compress two lines of code into one.
authorHeena Sirwani <heenasirwani@gmail.com>
Mon, 6 Oct 2014 04:49:09 +0000 (10:19 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Oct 2014 02:29:18 +0000 (10:29 +0800)
The following patch merges two lines of code into one using coccinelle
and removes unused variables. The semantic patch used is as follows:

@@
expression ret;
identifier f;
@@

-ret =
+return
     f(...);
-return ret;

Signed-off-by: Heena Sirwani <heenasirwani@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/dgnc/dgnc_cls.c

index a17f4f6095c827c0370cbad4b3867830d9c8b125..f0b1ec7847e73836bab190817990fd47089f0999 100644 (file)
@@ -964,7 +964,6 @@ static int cls_drain(struct tty_struct *tty, uint seconds)
        unsigned long flags;
        struct channel_t *ch;
        struct un_t *un;
-       int rc = 0;
 
        if (!tty || tty->magic != TTY_MAGIC)
                return -ENXIO;
@@ -984,12 +983,11 @@ static int cls_drain(struct tty_struct *tty, uint seconds)
        /*
         * NOTE: Do something with time passed in.
         */
-       rc = wait_event_interruptible(un->un_flags_wait,
-                                        ((un->un_flags & UN_EMPTY) == 0));
 
        /* If ret is non-zero, user ctrl-c'ed us */
 
-       return rc;
+       return wait_event_interruptible(un->un_flags_wait,
+                                        ((un->un_flags & UN_EMPTY) == 0));
 }