staging: comedi: Compress return logic into one line.
authorVarsha Rao <rvarsha016@gmail.com>
Sun, 12 Mar 2017 15:07:30 +0000 (20:37 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 13 Mar 2017 22:27:31 +0000 (06:27 +0800)
Simplify function return by merging assignment and return into a single
line. The following coccinelle script is used to fix this issue.

@@
expression e;
local idexpression ret;
@@

-ret = e;
-return ret;
+return e;

Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/cb_pcidas64.c

index 3b98193de0a4a0fad895696bc9277be671adecb3..b761f000c1dc2ff158eb6586a2dca7ad870e879e 100644 (file)
@@ -1417,9 +1417,7 @@ static int set_ai_fifo_size(struct comedi_device *dev, unsigned int num_samples)
        if (retval < 0)
                return retval;
 
-       num_samples = retval * fifo->num_segments * fifo->sample_packing_ratio;
-
-       return num_samples;
+       return retval * fifo->num_segments * fifo->sample_packing_ratio;
 }
 
 /* query length of fifo */