|
From: | Eric Blake |
Subject: | Re: [PATCH v8 02/10] scripts: add coccinelle script to use auto propagated errp |
Date: | Fri, 6 Mar 2020 06:43:43 -0600 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 |
On 3/5/20 11:15 PM, Vladimir Sementsov-Ogievskiy wrote:
Script adds ERRP_AUTO_PROPAGATE macro invocation where appropriate and does corresponding changes in code (look for details in include/qapi/error.h) Usage example: spatch --sp-file scripts/coccinelle/auto-propagated-errp.cocci \ --macro-file scripts/cocci-macro-file.h --in-place --no-show-diff \ blockdev-nbd.c qemu-nbd.c {block/nbd*,nbd/*,include/block/nbd*}.[hc] Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden> ---
I'll let Markus do the final review of this, but my personal take is that if the subsequent patches created by using this script are reasonable, then this script was good enough.
+// Always use the same patter for checking error
pattern
+@@ +identifier rule1.fn; +symbol errp; +@@ + + fn(...) + { + <... +- *errp != NULL ++ *errp + ...> + }
-- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
[Prev in Thread] | Current Thread | [Next in Thread] |