diff options
author | Eric Blake | 2017-06-24 20:10:08 +0200 |
---|---|---|
committer | Markus Armbruster | 2017-07-12 17:51:54 +0200 |
commit | 8a4613a0ab4b6e9271e64aaa88f588ed1b749eb4 (patch) | |
tree | 9e358ef25717802e6e40937ac11ebb91a8355091 /scripts | |
parent | qobject: Catch another straggler for use of qdict_put_str() (diff) | |
download | qemu-8a4613a0ab4b6e9271e64aaa88f588ed1b749eb4.tar.gz qemu-8a4613a0ab4b6e9271e64aaa88f588ed1b749eb4.tar.xz qemu-8a4613a0ab4b6e9271e64aaa88f588ed1b749eb4.zip |
qobject: Update coccinelle script to catch Q{INC, DEC}REF
The recent commit b097efc0 used qobject_decref(QOBJECT(E)), even
though we already have QDECREF(E) for that purpose. We can update
our coccinelle script to catch any future relapses; with that in
place, the rest of the patch is generated with:
spatch --sp-file scripts/coccinelle/qobject.cocci \
--macro-file scripts/cocci-macro-file.h --dir . --in-place
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20170624181008.25497-3-eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/coccinelle/qobject.cocci | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/coccinelle/qobject.cocci b/scripts/coccinelle/qobject.cocci index c3253deb1b..c518caf7b1 100644 --- a/scripts/coccinelle/qobject.cocci +++ b/scripts/coccinelle/qobject.cocci @@ -3,6 +3,12 @@ expression Obj, Key, E; @@ ( +- qobject_incref(QOBJECT(E)); ++ QINCREF(E); +| +- qobject_decref(QOBJECT(E)); ++ QDECREF(E); +| - qdict_put_obj(Obj, Key, QOBJECT(E)); + qdict_put(Obj, Key, E); | |