]> git.proxmox.com Git - mirror_qemu.git/blame - scripts/coccinelle/remove_local_err.cocci
minikconf: do not include variables from MINIKCONF_ARGS in config-all-devices.mak
[mirror_qemu.git] / scripts / coccinelle / remove_local_err.cocci
CommitLineData
6b62d961
EH
1// Replace unnecessary usage of local_err variable with
2// direct usage of errp argument
3
4@@
5identifier F;
6expression list ARGS;
7expression F2;
8identifier LOCAL_ERR;
9identifier ERRP;
10idexpression V;
11typedef Error;
12@@
13 F(..., Error **ERRP)
14 {
15 ...
16- Error *LOCAL_ERR;
17 ... when != LOCAL_ERR
18 when != ERRP
19(
20- F2(ARGS, &LOCAL_ERR);
21- error_propagate(ERRP, LOCAL_ERR);
22+ F2(ARGS, ERRP);
23|
24- V = F2(ARGS, &LOCAL_ERR);
25- error_propagate(ERRP, LOCAL_ERR);
26+ V = F2(ARGS, ERRP);
27)
28 ... when != LOCAL_ERR
29 }