1
0
Fork 0
qemu/scripts/coccinelle/remove_local_err.cocci
Daniel Baumann ea34ddeea6
Adding upstream version 1:10.0.2+ds.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-22 14:27:05 +02:00

29 lines
541 B
Text

// Replace unnecessary usage of local_err variable with
// direct usage of errp argument
@@
identifier F;
expression list ARGS;
expression F2;
identifier LOCAL_ERR;
identifier ERRP;
idexpression V;
typedef Error;
@@
F(..., Error **ERRP)
{
...
- Error *LOCAL_ERR;
... when != LOCAL_ERR
when != ERRP
(
- F2(ARGS, &LOCAL_ERR);
- error_propagate(ERRP, LOCAL_ERR);
+ F2(ARGS, ERRP);
|
- V = F2(ARGS, &LOCAL_ERR);
- error_propagate(ERRP, LOCAL_ERR);
+ V = F2(ARGS, ERRP);
)
... when != LOCAL_ERR
}