* [PATCH 0/9] drop unneeded goto
@ 2015-05-28 21:02 Julia Lawall
2015-05-28 21:02 ` [PATCH 5/9] wl1251: " Julia Lawall
0 siblings, 1 reply; 3+ messages in thread
From: Julia Lawall @ 2015-05-28 21:02 UTC (permalink / raw)
To: devel
Cc: kernel-janitors, HPDD-discuss, linux-rdma, netdev, linux-kernel,
linux-media, linux-nfs, linux-wireless
These patches drop gotos that jump to a label that is at the next
instruction, in the case that the label is not used elsewhere in the
function. The complete semantic patch that performs this transformation is
as follows:
// <smpl>
@r@
position p;
identifier l;
@@
if (...) goto l@p;
l:
@script:ocaml s@
p << r.p;
nm;
@@
nm := (List.hd p).current_element
@ok exists@
identifier s.nm,l;
position p != r.p;
@@
nm(...) {
<+... goto l@p; ...+>
}
@depends on !ok@
identifier s.nm;
position r.p;
identifier l;
@@
nm(...) {
<...
- if(...) goto l@p; l:
...>
}
// </smpl>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 5/9] wl1251: drop unneeded goto
2015-05-28 21:02 [PATCH 0/9] drop unneeded goto Julia Lawall
@ 2015-05-28 21:02 ` Julia Lawall
2015-06-08 8:39 ` [5/9] " Kalle Valo
0 siblings, 1 reply; 3+ messages in thread
From: Julia Lawall @ 2015-05-28 21:02 UTC (permalink / raw)
To: Kalle Valo; +Cc: kernel-janitors, linux-wireless, netdev, linux-kernel
From: Julia Lawall <Julia.Lawall@lip6.fr>
Delete jump to a label on the next line, when that label is not
used elsewhere.
A simplified version of the semantic patch that makes this change is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@r@
identifier l;
@@
-if (...) goto l;
-l:
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/net/wireless/ti/wl1251/acx.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/net/wireless/ti/wl1251/acx.c b/drivers/net/wireless/ti/wl1251/acx.c
index 5695628..d6fbdda 100644
--- a/drivers/net/wireless/ti/wl1251/acx.c
+++ b/drivers/net/wireless/ti/wl1251/acx.c
@@ -53,10 +53,7 @@ int wl1251_acx_station_id(struct wl1251 *wl)
mac->mac[i] = wl->mac_addr[ETH_ALEN - 1 - i];
ret = wl1251_cmd_configure(wl, DOT11_STATION_ID, mac, sizeof(*mac));
- if (ret < 0)
- goto out;
-out:
kfree(mac);
return ret;
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [5/9] wl1251: drop unneeded goto
2015-05-28 21:02 ` [PATCH 5/9] wl1251: " Julia Lawall
@ 2015-06-08 8:39 ` Kalle Valo
0 siblings, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2015-06-08 8:39 UTC (permalink / raw)
To: Julia Lawall; +Cc: kernel-janitors, linux-wireless, netdev, linux-kernel
> From: Julia Lawall <Julia.Lawall@lip6.fr>
>
> Delete jump to a label on the next line, when that label is not
> used elsewhere.
>
> A simplified version of the semantic patch that makes this change is as
> follows: (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @r@
> identifier l;
> @@
>
> -if (...) goto l;
> -l:
> // </smpl>
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Thanks, applied to wireless-drivers-next.git.
Kalle Valo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-06-08 8:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-28 21:02 [PATCH 0/9] drop unneeded goto Julia Lawall
2015-05-28 21:02 ` [PATCH 5/9] wl1251: " Julia Lawall
2015-06-08 8:39 ` [5/9] " Kalle Valo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).