scripts: Coccinelle script to use ERRP_GUARD()

Script adds ERRP_GUARD() macro invocations where appropriate and
does corresponding changes in code (look for details in
include/qapi/error.h)

Usage example:
spatch --sp-file scripts/coccinelle/errp-guard.cocci \
 --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff \
 --max-width 80 FILES...

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200707165037.1026246-3-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[ERRP_AUTO_PROPAGATE() renamed to ERRP_GUARD(), and
auto-propagated-errp.cocci to errp-guard.cocci]
This commit is contained in:
Vladimir Sementsov-Ogievskiy 2020-07-07 18:50:31 +02:00 committed by Markus Armbruster
parent ae7c80a7bd
commit 8220f3ac74
3 changed files with 339 additions and 0 deletions

View file

@ -265,6 +265,8 @@
* }
* ...
* }
*
* For mass-conversion, use scripts/coccinelle/errp-guard.cocci.
*/
#ifndef ERROR_H