staging: iio: meter: remove unused variable
authorAya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Fri, 27 Feb 2015 13:08:38 +0000 (15:08 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 Mar 2015 00:25:25 +0000 (16:25 -0800)
This patch removes a variable that was simply used to
store the return value of a function call before
returning it.

The issue was detected and resolved using the following
coccinelle script:

@@
identifier len,f;
@@

-int len;
 ... when != len
     when strict
-len =
+return
        f(...);
-return len;

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/iio/meter/ade7759.c

index b0c7dbc8a4283c88de229bc2332676a82412e9a5..694e0ce1f2778a37479c7b57d6c219e141571031 100644 (file)
@@ -215,18 +215,15 @@ error_ret:
 
 static int ade7759_reset(struct device *dev)
 {
-       int ret;
        u16 val;
 
        ade7759_spi_read_reg_16(dev,
                        ADE7759_MODE,
                        &val);
        val |= 1 << 6; /* Software Chip Reset */
-       ret = ade7759_spi_write_reg_16(dev,
+       return ade7759_spi_write_reg_16(dev,
                        ADE7759_MODE,
                        val);
-
-       return ret;
 }
 
 static IIO_DEV_ATTR_AENERGY(ade7759_read_40bit, ADE7759_AENERGY);