]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Staging: comedi: Compressed two lines of code into one.
authorHeena Sirwani <heenasirwani@gmail.com>
Mon, 6 Oct 2014 08:16:09 +0000 (13:46 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Oct 2014 02:29:13 +0000 (10:29 +0800)
The following patch compressed two lines of code into one using
coccinelle and removed an unused variable.
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/comedi/comedi_fops.c

index 495969f46e76656dbcaf3523b102c43ca0df495f..224af2b2a685874b69ca59c9c94747c407de2f0c 100644 (file)
@@ -1718,7 +1718,6 @@ static int do_cancel_ioctl(struct comedi_device *dev, unsigned int arg,
                           void *file)
 {
        struct comedi_subdevice *s;
-       int ret;
 
        if (arg >= dev->n_subdevices)
                return -EINVAL;
@@ -1732,9 +1731,7 @@ static int do_cancel_ioctl(struct comedi_device *dev, unsigned int arg,
        if (s->busy != file)
                return -EBUSY;
 
-       ret = do_cancel(dev, s);
-
-       return ret;
+       return do_cancel(dev, s);
 }
 
 /*