repo.or.cz
/
qemu
/
ar7.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Merge remote-tracking branch 'qemu-project/master'
[qemu/ar7.git]
/
scripts
/
coccinelle
/
return_directly.cocci
blob
6cb1b3c99a77a5cf5a1bd4fd97e6273a46da83a8
1
// replace 'R = X; return R;' with 'return X;'
2
@@
3
identifier VAR;
4
expression E;
5
type T;
6
identifier F;
7
@@
8
T F(...)
9
{
10
...
11
- T VAR;
12
... when != VAR
13
14
- VAR = (E);
15
- return VAR;
16
+ return E;
17
... when != VAR
18
}