All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: iio: return expression instead of return ret
@ 2017-03-10  3:57 Bo Yu
  2017-03-11 18:25 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Bo Yu @ 2017-03-10  3:57 UTC (permalink / raw)
  To: Clausen, Kroah-Hartman, Hennerich, Cameron, Knaack,
	Meerwald-Stadler, tsu.yubo
  Cc: devel, linux-kernel, linux-iio

The following Coccinelle script was used to detect this:

@@
local idexpression ret;
expression e;
@@

-ret =
+return
       e;
-return ret;

Signed-off-by: Bo YU <tsu.yubo@gmail.com>
---
   drivers/staging/iio/meter/ade7754.c |    3 +--
   1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/iio/meter/ade7754.c b/drivers/staging/iio/meter/ade7754.c
index 024463a11c47..19f8cb144768 100644
--- a/drivers/staging/iio/meter/ade7754.c
+++ b/drivers/staging/iio/meter/ade7754.c
@@ -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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Staging: iio: return expression instead of return ret
  2017-03-10  3:57 [PATCH] Staging: iio: return expression instead of return ret Bo Yu
@ 2017-03-11 18:25 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2017-03-11 18:25 UTC (permalink / raw)
  To: Bo Yu, Clausen, Kroah-Hartman, Hennerich, Knaack, Meerwald-Stadler
  Cc: devel, linux-kernel, linux-iio

On 10/03/17 03:57, Bo Yu wrote:
> The following Coccinelle script was used to detect this:
> 
> @@
> local idexpression ret;
> expression e;
> @@
> 
> -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
> 
> Signed-off-by: Bo YU <tsu.yubo@gmail.com>
> ---
>   drivers/staging/iio/meter/ade7754.c |    3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/iio/meter/ade7754.c b/drivers/staging/iio/meter/ade7754.c
> index 024463a11c47..19f8cb144768 100644
> --- a/drivers/staging/iio/meter/ade7754.c
> +++ b/drivers/staging/iio/meter/ade7754.c
> @@ -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
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-03-11 18:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-10  3:57 [PATCH] Staging: iio: return expression instead of return ret Bo Yu
2017-03-11 18:25 ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.