On 7/7/20 11:24 PM, Markus Armbruster wrote: > From: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> > > 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 <vsement...@virtuozzo.com> > Reviewed-by: Markus Armbruster <arm...@redhat.com> > Signed-off-by: Markus Armbruster <arm...@redhat.com> > Message-Id: <20200707165037.1026246-3-arm...@redhat.com> > Reviewed-by: Eric Blake <ebl...@redhat.com> > [ERRP_AUTO_PROPAGATE() renamed to ERRP_GUARD(), and > auto-propagated-errp.cocci to errp-guard.cocci] > --- > scripts/coccinelle/errp-guard.cocci | 336 ++++++++++++++++++++++++++++ > include/qapi/error.h | 2 + > MAINTAINERS | 1 + > 3 files changed, 339 insertions(+) > create mode 100644 scripts/coccinelle/errp-guard.cocci
Odd, this script fails on Fedora rawhide: $ spatch --macro-file scripts/cocci-macro-file.h --sp-file scripts/coccinelle/errp-guard.cocci --use-gitgrep --dir . There is no standard.iso in /usr/lib64/coccinelle. Are you sure you run a properly installed version of spatch ?\ninit_defs_builtins: /usr/lib64/coccinelle/standard.h init_defs: scripts/cocci-macro-file.h minus: parse error: File "scripts/coccinelle/errp-guard.cocci", line 54, column 5, charpos = 1899 around = '<...', whole content = <... $ spatch --version There is no standard.iso in /usr/lib64/coccinelle. Are you sure you run a properly installed version of spatch ?\nspatch version 1.1.0-gc4cc9f6-dirty compiled with OCaml version 4.12.0 Flags passed to the configure script: --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-python=/usr/bin/python3 --with-menhir=/usr/bin/menhir OCaml scripting support: yes Python scripting support: yes Syntax of regular expressions: PCRE $ ls /usr/lib64/coccinelle ocaml spatch standard.h standard.iso