Skip to contentSkip to conversation

Staging: iio: return expression instead of return ret

PATCH In review Bo Yu 2 participants 2 messages Mar 10, 2017 – Mar 11, 2017

Subsystems (4)
lore
Share & tools
lore

Bo Yu

author
#0 lore raw

PATCH 1/1 Staging: iio: return expression instead of return ret

The following Coccinelle script was used to detect this:

@@
local idexpression ret;
expression e;
@@

-ret =
+return

      e;

-return ret;

---
  drivers/staging/iio/meter/ade7754.c |    3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/iio/meter/ade7754.c +1 -2
index 024463a11c47..19f8cb144768 100644
@@ -349,9 +349,8 @@ static int ade7754_set_irq(struct device *dev, bool enable)
  	else
  		irqen &= ~BIT(14);
 
-	ret = ade7754_spi_write_reg_16(dev, ADE7754_IRQEN, irqen);
+	return ade7754_spi_write_reg_16(dev, ADE7754_IRQEN, irqen);
 
-	return ret;
  }
 
  /* Power down the device */

--
1.7.10.4

maintainer
#1 lore raw

Review

Quoted 11 lines · Bo Yu

The following Coccinelle script was used to detect this:

@@
local idexpression ret;
expression e;
@@

(quoted diff) +1 -2
-ret =
+return
      e;
-return ret;

A bit of fuzz on this one. Presumably things moving around in other recent changes.

Anyhow, applied to the togreg branch of iio.git. Will push out as testing shortly for the autobuilders to play with it.

Thanks,

Jonathan

Quoted 24 lines
---
  drivers/staging/iio/meter/ade7754.c |    3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/iio/meter/ade7754.c +1 -2
index 024463a11c47..19f8cb144768 100644
@@ -349,9 +349,8 @@ static int ade7754_set_irq(struct device *dev, bool enable)
      else
          irqen &= ~BIT(14);
 
-    ret = ade7754_spi_write_reg_16(dev, ADE7754_IRQEN, irqen);
+    return ade7754_spi_write_reg_16(dev, ADE7754_IRQEN, irqen);
 
-    return ret;
  }
 
  /* Power down the device */
Signature · 1 line
1.7.10.4