* [PATCH 1/5] Staging: media: Remove Unnecessary goto.
2016-02-29 11:08 [PATCH 0/5] Staging: Remove unnecessary goto Sandhya Bankar
@ 2016-02-29 11:11 ` Sandhya Bankar
2016-03-01 11:37 ` [Outreachy kernel] " Daniel Baluta
2016-02-29 11:16 ` [PATCH 2/5] Staging: iio: ade7854: Remove unnecessary goto Sandhya Bankar
` (4 subsequent siblings)
5 siblings, 1 reply; 13+ messages in thread
From: Sandhya Bankar @ 2016-02-29 11:11 UTC (permalink / raw)
To: outreachy-kernel
Remove unnecessary goto.
Semantic patch:
@r@
expression ret;
identifier f,l;
statement S;
position p;
@@
(
if (<+...f(...)...+>) S
|
if@p (...) return ret;
return ret;
|
if@p (...) goto l;
l:
return ret;
)
Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
---
drivers/staging/media/bcm2048/radio-bcm2048.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c b/drivers/staging/media/bcm2048/radio-bcm2048.c
index 8fdf0ac..05afbb4 100644
--- a/drivers/staging/media/bcm2048/radio-bcm2048.c
+++ b/drivers/staging/media/bcm2048/radio-bcm2048.c
@@ -1835,8 +1835,6 @@ static int bcm2048_deinit(struct bcm2048_device *bdev)
goto exit;
err = bcm2048_set_power_state(bdev, BCM2048_POWER_OFF);
- if (err < 0)
- goto exit;
exit:
return err;
--
1.8.3.4
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [Outreachy kernel] [PATCH 1/5] Staging: media: Remove Unnecessary goto.
2016-02-29 11:11 ` [PATCH 1/5] Staging: media: Remove Unnecessary goto Sandhya Bankar
@ 2016-03-01 11:37 ` Daniel Baluta
0 siblings, 0 replies; 13+ messages in thread
From: Daniel Baluta @ 2016-03-01 11:37 UTC (permalink / raw)
To: Sandhya Bankar; +Cc: outreachy-kernel
On Mon, Feb 29, 2016 at 1:11 PM, Sandhya Bankar
<bankarsandhya512@gmail.com> wrote:
> Remove unnecessary goto.
> Semantic patch:
> @r@
> expression ret;
> identifier f,l;
> statement S;
> position p;
> @@
>
> (
> if (<+...f(...)...+>) S
> |
> if@p (...) return ret;
> return ret;
> |
> if@p (...) goto l;
> l:
> return ret;
> )
>
> Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Same here. You can completely remove the goto label.
> ---
> drivers/staging/media/bcm2048/radio-bcm2048.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c b/drivers/staging/media/bcm2048/radio-bcm2048.c
> index 8fdf0ac..05afbb4 100644
> --- a/drivers/staging/media/bcm2048/radio-bcm2048.c
> +++ b/drivers/staging/media/bcm2048/radio-bcm2048.c
> @@ -1835,8 +1835,6 @@ static int bcm2048_deinit(struct bcm2048_device *bdev)
> goto exit;
>
> err = bcm2048_set_power_state(bdev, BCM2048_POWER_OFF);
> - if (err < 0)
> - goto exit;
>
> exit:
> return err;
> --
> 1.8.3.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 outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1ba56a683ed2fc412718a7ccdfb0887c9fb9e27d.1456743650.git.bankarsandhya512%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 2/5] Staging: iio: ade7854: Remove unnecessary goto.
2016-02-29 11:08 [PATCH 0/5] Staging: Remove unnecessary goto Sandhya Bankar
2016-02-29 11:11 ` [PATCH 1/5] Staging: media: Remove Unnecessary goto Sandhya Bankar
@ 2016-02-29 11:16 ` Sandhya Bankar
2016-03-01 11:35 ` [Outreachy kernel] " Daniel Baluta
2016-02-29 11:23 ` [PATCH 3/5] Staging: iio: ade7758_core: " Sandhya Bankar
` (3 subsequent siblings)
5 siblings, 1 reply; 13+ messages in thread
From: Sandhya Bankar @ 2016-02-29 11:16 UTC (permalink / raw)
To: outreachy-kernel
Remove unnecessary goto.
Semantic patch:
@r@
expression ret;
identifier f,l;
statement S;
position p;
@@
(
if (<+...f(...)...+>) S
|
if@p (...) return ret;
return ret;
|
if@p (...) goto l;
l:
return ret;
)
Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
---
drivers/staging/iio/meter/ade7854.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/staging/iio/meter/ade7854.c b/drivers/staging/iio/meter/ade7854.c
index a838835..d37a69e 100644
--- a/drivers/staging/iio/meter/ade7854.c
+++ b/drivers/staging/iio/meter/ade7854.c
@@ -426,8 +426,6 @@ static int ade7854_set_irq(struct device *dev, bool enable)
irqen &= ~BIT(17);
ret = st->write_reg_32(dev, ADE7854_MASK0, irqen);
- if (ret)
- goto error_ret;
error_ret:
return ret;
--
1.8.3.4
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [Outreachy kernel] [PATCH 2/5] Staging: iio: ade7854: Remove unnecessary goto.
2016-02-29 11:16 ` [PATCH 2/5] Staging: iio: ade7854: Remove unnecessary goto Sandhya Bankar
@ 2016-03-01 11:35 ` Daniel Baluta
0 siblings, 0 replies; 13+ messages in thread
From: Daniel Baluta @ 2016-03-01 11:35 UTC (permalink / raw)
To: Sandhya Bankar; +Cc: outreachy-kernel
On Mon, Feb 29, 2016 at 1:16 PM, Sandhya Bankar
<bankarsandhya512@gmail.com> wrote:
> Remove unnecessary goto.
> Semantic patch:
> @r@
> expression ret;
> identifier f,l;
> statement S;
> position p;
> @@
>
> (
> if (<+...f(...)...+>) S
> |
> if@p (...) return ret;
> return ret;
> |
> if@p (...) goto l;
> l:
> return ret;
> )
>
> Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Same comments here as for patch 3/5.
> ---
> drivers/staging/iio/meter/ade7854.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/staging/iio/meter/ade7854.c b/drivers/staging/iio/meter/ade7854.c
> index a838835..d37a69e 100644
> --- a/drivers/staging/iio/meter/ade7854.c
> +++ b/drivers/staging/iio/meter/ade7854.c
> @@ -426,8 +426,6 @@ static int ade7854_set_irq(struct device *dev, bool enable)
> irqen &= ~BIT(17);
>
> ret = st->write_reg_32(dev, ADE7854_MASK0, irqen);
> - if (ret)
> - goto error_ret;
>
> error_ret:
> return ret;
> --
> 1.8.3.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 outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1f6d0a1ada00c114df4989bfa438bcecd1a70969.1456743650.git.bankarsandhya512%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 3/5] Staging: iio: ade7758_core: Remove unnecessary goto.
2016-02-29 11:08 [PATCH 0/5] Staging: Remove unnecessary goto Sandhya Bankar
2016-02-29 11:11 ` [PATCH 1/5] Staging: media: Remove Unnecessary goto Sandhya Bankar
2016-02-29 11:16 ` [PATCH 2/5] Staging: iio: ade7854: Remove unnecessary goto Sandhya Bankar
@ 2016-02-29 11:23 ` Sandhya Bankar
2016-03-01 11:33 ` [Outreachy kernel] " Daniel Baluta
2016-02-29 11:26 ` [PATCH 4/5] Staging: iio: ade7754: " Sandhya Bankar
` (2 subsequent siblings)
5 siblings, 1 reply; 13+ messages in thread
From: Sandhya Bankar @ 2016-02-29 11:23 UTC (permalink / raw)
To: outreachy-kernel
Remove unnecessary goto.
Used below semantic patch to detect the unnecessary goto:
@r@
expression ret;
identifier f,l;
statement S;
position p;
@@
(
if (<+...f(...)...+>) S
|
if@p (...) return ret;
return ret;
|
if@p (...) goto l;
l:
return ret;
)
Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
---
drivers/staging/iio/meter/ade7758_core.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/staging/iio/meter/ade7758_core.c b/drivers/staging/iio/meter/ade7758_core.c
index 0db23e4..32792d0 100644
--- a/drivers/staging/iio/meter/ade7758_core.c
+++ b/drivers/staging/iio/meter/ade7758_core.c
@@ -432,8 +432,6 @@ int ade7758_set_irq(struct device *dev, bool enable)
irqen &= ~BIT(16);
ret = ade7758_spi_write_reg_24(dev, ADE7758_MASK, irqen);
- if (ret)
- goto error_ret;
error_ret:
return ret;
--
1.8.3.4
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [Outreachy kernel] [PATCH 3/5] Staging: iio: ade7758_core: Remove unnecessary goto.
2016-02-29 11:23 ` [PATCH 3/5] Staging: iio: ade7758_core: " Sandhya Bankar
@ 2016-03-01 11:33 ` Daniel Baluta
0 siblings, 0 replies; 13+ messages in thread
From: Daniel Baluta @ 2016-03-01 11:33 UTC (permalink / raw)
To: Sandhya Bankar; +Cc: outreachy-kernel
On Mon, Feb 29, 2016 at 1:23 PM, Sandhya Bankar
<bankarsandhya512@gmail.com> wrote:
> Remove unnecessary goto.
> Used below semantic patch to detect the unnecessary goto:
> @r@
> expression ret;
> identifier f,l;
> statement S;
> position p;
> @@
>
> (
> if (<+...f(...)...+>) S
> |
> if@p (...) return ret;
> return ret;
> |
> if@p (...) goto l;
> l:
> return ret;
> )
>
> Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
> ---
> drivers/staging/iio/meter/ade7758_core.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/staging/iio/meter/ade7758_core.c b/drivers/staging/iio/meter/ade7758_core.c
> index 0db23e4..32792d0 100644
> --- a/drivers/staging/iio/meter/ade7758_core.c
> +++ b/drivers/staging/iio/meter/ade7758_core.c
> @@ -432,8 +432,6 @@ int ade7758_set_irq(struct device *dev, bool enable)
> irqen &= ~BIT(16);
>
> ret = ade7758_spi_write_reg_24(dev, ADE7758_MASK, irqen);
> - if (ret)
> - goto error_ret;
>
> error_ret:
> return ret;
Here you can just return ade7758_spi_write_reg_24(...). Also you can completely
remove the goto label by modifying the code at the beginning of the
function as follows:
ret = ade7758_spi_read_reg_24(dev, ADE7758_MASK, &irqen);
if (ret)
return ret;
Daniel.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 4/5] Staging: iio: ade7754: Remove unnecessary goto.
2016-02-29 11:08 [PATCH 0/5] Staging: Remove unnecessary goto Sandhya Bankar
` (2 preceding siblings ...)
2016-02-29 11:23 ` [PATCH 3/5] Staging: iio: ade7758_core: " Sandhya Bankar
@ 2016-02-29 11:26 ` Sandhya Bankar
2016-03-01 11:36 ` [Outreachy kernel] " Daniel Baluta
2016-02-29 11:27 ` [PATCH 5/5] Staging: gdm72xx: " Sandhya Bankar
2016-02-29 19:11 ` [Outreachy kernel] [PATCH 0/5] Staging: " Julia Lawall
5 siblings, 1 reply; 13+ messages in thread
From: Sandhya Bankar @ 2016-02-29 11:26 UTC (permalink / raw)
To: outreachy-kernel
Remove unnecessary goto.
Used below semantic patch to detect the unnecessary goto:
@r@
expression ret;
identifier f,l;
statement S;
position p;
@@
(
if (<+...f(...)...+>) S
|
if@p (...) return ret;
return ret;
|
if@p (...) goto l;
l:
return ret;
)
Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
---
drivers/staging/iio/meter/ade7754.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/staging/iio/meter/ade7754.c b/drivers/staging/iio/meter/ade7754.c
index 1e95068..6e931cd 100644
--- a/drivers/staging/iio/meter/ade7754.c
+++ b/drivers/staging/iio/meter/ade7754.c
@@ -356,8 +356,6 @@ static int ade7754_set_irq(struct device *dev, bool enable)
irqen &= ~BIT(14);
ret = ade7754_spi_write_reg_16(dev, ADE7754_IRQEN, irqen);
- if (ret)
- goto error_ret;
error_ret:
return ret;
--
1.8.3.4
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [Outreachy kernel] [PATCH 4/5] Staging: iio: ade7754: Remove unnecessary goto.
2016-02-29 11:26 ` [PATCH 4/5] Staging: iio: ade7754: " Sandhya Bankar
@ 2016-03-01 11:36 ` Daniel Baluta
0 siblings, 0 replies; 13+ messages in thread
From: Daniel Baluta @ 2016-03-01 11:36 UTC (permalink / raw)
To: Sandhya Bankar; +Cc: outreachy-kernel
On Mon, Feb 29, 2016 at 1:26 PM, Sandhya Bankar
<bankarsandhya512@gmail.com> wrote:
> Remove unnecessary goto.
> Used below semantic patch to detect the unnecessary goto:
> @r@
> expression ret;
> identifier f,l;
> statement S;
> position p;
> @@
>
> (
> if (<+...f(...)...+>) S
> |
> if@p (...) return ret;
> return ret;
> |
> if@p (...) goto l;
> l:
> return ret;
> )
>
> Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Same comments here as for patch 3/5.
> ---
> drivers/staging/iio/meter/ade7754.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/staging/iio/meter/ade7754.c b/drivers/staging/iio/meter/ade7754.c
> index 1e95068..6e931cd 100644
> --- a/drivers/staging/iio/meter/ade7754.c
> +++ b/drivers/staging/iio/meter/ade7754.c
> @@ -356,8 +356,6 @@ static int ade7754_set_irq(struct device *dev, bool enable)
> irqen &= ~BIT(14);
>
> ret = ade7754_spi_write_reg_16(dev, ADE7754_IRQEN, irqen);
> - if (ret)
> - goto error_ret;
>
> error_ret:
> return ret;
> --
> 1.8.3.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 outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/9e4e14d33fb7f6f9eb3255b263773384cfc573ff.1456743650.git.bankarsandhya512%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 5/5] Staging: gdm72xx: Remove unnecessary goto.
2016-02-29 11:08 [PATCH 0/5] Staging: Remove unnecessary goto Sandhya Bankar
` (3 preceding siblings ...)
2016-02-29 11:26 ` [PATCH 4/5] Staging: iio: ade7754: " Sandhya Bankar
@ 2016-02-29 11:27 ` Sandhya Bankar
2016-02-29 19:11 ` [Outreachy kernel] [PATCH 0/5] Staging: " Julia Lawall
5 siblings, 0 replies; 13+ messages in thread
From: Sandhya Bankar @ 2016-02-29 11:27 UTC (permalink / raw)
To: outreachy-kernel
Remove unnecessary goto.
Used below semantic patch to detect the unnecessary goto:
@r@
expression ret;
identifier f,l;
statement S;
position p;
@@
(
if (<+...f(...)...+>) S
|
if@p (...) return ret;
return ret;
|
if@p (...) goto l;
l:
return ret;
)
Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
---
drivers/staging/gdm72xx/usb_boot.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/gdm72xx/usb_boot.c b/drivers/staging/gdm72xx/usb_boot.c
index 99a5c07..eb28c2e 100644
--- a/drivers/staging/gdm72xx/usb_boot.c
+++ b/drivers/staging/gdm72xx/usb_boot.c
@@ -257,8 +257,7 @@ static int em_wait_ack(struct usb_device *usbdev, int send_zlp)
/*Wait for ACK*/
ret = gdm_wibro_recv(usbdev, &ack, sizeof(ack));
- if (ret < 0)
- goto out;
+
out:
return ret;
}
--
1.8.3.4
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [Outreachy kernel] [PATCH 0/5] Staging: Remove unnecessary goto.
2016-02-29 11:08 [PATCH 0/5] Staging: Remove unnecessary goto Sandhya Bankar
` (4 preceding siblings ...)
2016-02-29 11:27 ` [PATCH 5/5] Staging: gdm72xx: " Sandhya Bankar
@ 2016-02-29 19:11 ` Julia Lawall
2016-02-29 19:30 ` sandhya bankar
5 siblings, 1 reply; 13+ messages in thread
From: Julia Lawall @ 2016-02-29 19:11 UTC (permalink / raw)
To: Sandhya Bankar; +Cc: outreachy-kernel
On Mon, 29 Feb 2016, Sandhya Bankar wrote:
> Remove unnecessary goto.
> Semantic patch:
> @r@
> expression ret;
> identifier f,l;
> statement S;
> position p;
> @@
>
> (
> if (<+...f(...)...+>) S
> |
> if@p (...) return ret;
> return ret;
> |
> if@p (...) goto l;
> l:
> return ret;
> )
The semantic patch doesn't remove (or add) anything?
julia
>
> Sandhya Bankar (5):
> Staging: media: Remove Unnecessary goto.
> Staging: iio: ade7854: Remove unnecessary goto.
> Staging: iio: ade7758_core: Remove unnecessary goto.
> Staging: iio: ade7754: Remove unnecessary goto.
> Staging: gdm72xx: Remove unnecessary goto.
>
> drivers/staging/gdm72xx/usb_boot.c | 3 +--
> drivers/staging/iio/meter/ade7754.c | 2 --
> drivers/staging/iio/meter/ade7758_core.c | 2 --
> drivers/staging/iio/meter/ade7854.c | 2 --
> drivers/staging/media/bcm2048/radio-bcm2048.c | 2 --
> 5 files changed, 1 insertion(+), 10 deletions(-)
>
> --
> 1.8.3.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 outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/cover.1456743650.git.bankarsandhya512%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [Outreachy kernel] [PATCH 0/5] Staging: Remove unnecessary goto.
2016-02-29 19:11 ` [Outreachy kernel] [PATCH 0/5] Staging: " Julia Lawall
@ 2016-02-29 19:30 ` sandhya bankar
2016-02-29 21:35 ` Julia Lawall
0 siblings, 1 reply; 13+ messages in thread
From: sandhya bankar @ 2016-02-29 19:30 UTC (permalink / raw)
To: Julia Lawall, outreachy-kernel
[-- Attachment #1: Type: text/plain, Size: 1758 bytes --]
I have used this semantic patch to detect the unnecessary goto.
On Tue, Mar 1, 2016 at 12:41 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>
>
> On Mon, 29 Feb 2016, Sandhya Bankar wrote:
>
> > Remove unnecessary goto.
> > Semantic patch:
> > @r@
> > expression ret;
> > identifier f,l;
> > statement S;
> > position p;
> > @@
> >
> > (
> > if (<+...f(...)...+>) S
> > |
> > if@p (...) return ret;
> > return ret;
> > |
> > if@p (...) goto l;
> > l:
> > return ret;
> > )
>
> The semantic patch doesn't remove (or add) anything?
>
> julia
>
> >
> > Sandhya Bankar (5):
> > Staging: media: Remove Unnecessary goto.
> > Staging: iio: ade7854: Remove unnecessary goto.
> > Staging: iio: ade7758_core: Remove unnecessary goto.
> > Staging: iio: ade7754: Remove unnecessary goto.
> > Staging: gdm72xx: Remove unnecessary goto.
> >
> > drivers/staging/gdm72xx/usb_boot.c | 3 +--
> > drivers/staging/iio/meter/ade7754.c | 2 --
> > drivers/staging/iio/meter/ade7758_core.c | 2 --
> > drivers/staging/iio/meter/ade7854.c | 2 --
> > drivers/staging/media/bcm2048/radio-bcm2048.c | 2 --
> > 5 files changed, 1 insertion(+), 10 deletions(-)
> >
> > --
> > 1.8.3.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 outreachy-kernel+unsubscribe@googlegroups.com.
> > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/outreachy-kernel/cover.1456743650.git.bankarsandhya512%40gmail.com
> .
> > For more options, visit https://groups.google.com/d/optout.
> >
>
[-- Attachment #2: Type: text/html, Size: 2881 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [Outreachy kernel] [PATCH 0/5] Staging: Remove unnecessary goto.
2016-02-29 19:30 ` sandhya bankar
@ 2016-02-29 21:35 ` Julia Lawall
0 siblings, 0 replies; 13+ messages in thread
From: Julia Lawall @ 2016-02-29 21:35 UTC (permalink / raw)
To: sandhya bankar; +Cc: outreachy-kernel
[-- Attachment #1: Type: TEXT/PLAIN, Size: 3008 bytes --]
On Tue, 1 Mar 2016, sandhya bankar wrote:
> I have used this semantic patch to detect the unnecessary goto.
A semantic patch that doesn't contain any annotations or script code
doesn't do anything. In the code that you have, there are a number of
cases, but one doesn't know if you are checking for all of them or only
some of them. You can use * to indicate the cases that you are searching
for, if you don't have a specific transformation to propose.
julia
>
> On Tue, Mar 1, 2016 at 12:41 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>
>
> On Mon, 29 Feb 2016, Sandhya Bankar wrote:
>
> > Remove unnecessary goto.
> > Semantic patch:
> > @r@
> > expression ret;
> > identifier f,l;
> > statement S;
> > position p;
> > @@
> >
> > (
> > if (<+...f(...)...+>) S
> > |
> > if@p (...) return ret;
> > return ret;
> > |
> > if@p (...) goto l;
> > l:
> > return ret;
> > )
>
> The semantic patch doesn't remove (or add) anything?
>
> julia
>
> >
> > Sandhya Bankar (5):
> > Staging: media: Remove Unnecessary goto.
> > Staging: iio: ade7854: Remove unnecessary goto.
> > Staging: iio: ade7758_core: Remove unnecessary goto.
> > Staging: iio: ade7754: Remove unnecessary goto.
> > Staging: gdm72xx: Remove unnecessary goto.
> >
> > drivers/staging/gdm72xx/usb_boot.c | 3 +--
> > drivers/staging/iio/meter/ade7754.c | 2 --
> > drivers/staging/iio/meter/ade7758_core.c | 2 --
> > drivers/staging/iio/meter/ade7854.c | 2 --
> > drivers/staging/media/bcm2048/radio-bcm2048.c | 2 --
> > 5 files changed, 1 insertion(+), 10 deletions(-)
> >
> > --
> > 1.8.3.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 outreachy-kernel+unsubscribe@googlegroups.com.
> > To post to this group, send email to
> outreachy-kernel@googlegroups.com.
> > To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/cover.1456743650.git.ban
> karsandhya512%40gmail.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
>
>
> --
> 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 outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visithttps://groups.google.com/d/msgid/outreachy-kernel/CAA3ASzmojvs8HDo2SZ168ND
> CsJjU84yL1YYw%3D%3Da0FDL_3PAnNA%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
^ permalink raw reply [flat|nested] 13+ messages in thread