staging: iio: compress return logic
Subsystems (4)
PATCH 1/1 staging: iio: compress return logic
Simplify function returns by merging assignment and return. Found with Coccinelle.
Semantic patch:
@@
local idexpression ret;
expression e;
@@
-ret =
+return
e;
-return ret;
--- drivers/staging/iio/meter/ade7854.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/iio/meter/ade7854.c +1 -3
@@ -426,9 +426,7 @@ static int ade7854_set_irq(struct device *dev, bool enable)else irqen &= ~BIT (17 ); - ret = st->write_reg_32 (dev,ADE7854_MASK0 , irqen); - -return ret; +return st->write_reg_32 (dev,ADE7854_MASK0 , irqen); }static int ade7854_initial_setup (struct iio_dev *indio_dev)
Signature · 1 line
2.7.4
Quoted 14 lines · Gargi Sharma
Simplify function returns by merging assignment and return. Found with Coccinelle.
Semantic patch:
@@
local idexpression ret;
expression e;
@@(quoted diff) +1
-2-ret = +return e; -return ret;
Quoted 1 line
Signed-off-by Gargi Sharma <[email protected]>
Quoted 29 lines
--- drivers/staging/iio/meter/ade7854.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/staging/iio/meter/ade7854.c +1
-4@@ -426,9 +426,7 @@ static int ade7854_set_irq(struct device *dev, bool enable)else irqen &= ~BIT (17 ); - ret = st->write_reg_32 (dev,ADE7854_MASK0 , irqen); - -return ret; +return st->write_reg_32 (dev,ADE7854_MASK0 , irqen); }static int ade7854_initial_setup (struct iio_dev *indio_dev) --2.7.4
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1487351841-6639-1-git-send-email-gs051095%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Jonathan Cameron
maintainerQuoted 13 lines · Julia Lawall
Quoted 9 lines · Gargi Sharma
Simplify function returns by merging assignment and return. Found with Coccinelle.
Semantic patch:
@@
local idexpression ret;
expression e;
@@
Quoted 8 lines
Quoted 6 lines
(quoted diff) +1
-2-ret = +return e; -return ret;Signed-off-by Gargi Sharma <[email protected]>Acked-by Julia Lawall <[email protected]>
Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it.
Thanks,
Jonathan
Quoted 30 lines
Quoted 30 lines
--- drivers/staging/iio/meter/ade7854.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)drivers/staging/iio/meter/ade7854.c +1
-4@@ -426,9 +426,7 @@ static int ade7854_set_irq(struct device *dev, bool enable)else irqen &= ~BIT (17 ); - ret = st->write_reg_32 (dev,ADE7854_MASK0 , irqen); - -return ret; +return st->write_reg_32 (dev,ADE7854_MASK0 , irqen); }static int ade7854_initial_setup (struct iio_dev *indio_dev) --2.7.4
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1487351841-6639-1-git-send-email-gs051095%40gmail.com.
For more options, visit https://groups.google.com/d/optout.