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
hw/riscv: Move sifive_u_otp model to hw/misc
[qemu/ar7.git]
/
scripts
/
coccinelle
/
return_directly.cocci
blob
4cf50e75ea035963ba0bfae7ea547121cc7f3c17
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 =
15
+ return
16
E;
17
- return VAR;
18
... when != VAR
19
}