From: Eric Blake <eblake@redhat.com>
To: qemu-devel@nongnu.org
Cc: armbru@redhat.com, marcandre.lureau@redhat.com, qemu-trivial@nongnu.org
Subject: [Qemu-devel] [PATCH 1/2] qobject: Update coccinelle script to catch Q{INC, DEC}REF
Date: Fri, 9 Jun 2017 10:20:16 -0500 [thread overview]
Message-ID: <20170609152017.7286-2-eblake@redhat.com> (raw)
In-Reply-To: <20170609152017.7286-1-eblake@redhat.com>
A recent patch submission was about to use qobject_decref(QOBJECT(E)),
even though we already have QDECREF(E) for that purpose. While our
tree is currently free from the longhand form, we might as well update
our coccinelle script to catch any future relapses.
Signed-off-by: Eric Blake <eblake@redhat.com>
---
scripts/coccinelle/qobject.cocci | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/scripts/coccinelle/qobject.cocci b/scripts/coccinelle/qobject.cocci
index 97703a4..656dc3e 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);
|
--
2.9.4
next prev parent reply other threads:[~2017-06-09 15:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-09 15:20 [Qemu-devel] [PATCH 0/2] qobject coccinelle followups Eric Blake
2017-06-09 15:20 ` Eric Blake [this message]
2017-06-09 15:28 ` [Qemu-devel] [PATCH 1/2] qobject: Update coccinelle script to catch Q{INC, DEC}REF Marc-André Lureau
2017-06-09 15:31 ` Marc-André Lureau
2017-06-09 15:33 ` Eric Blake
2017-06-09 15:36 ` Marc-André Lureau
2017-06-09 15:40 ` Eric Blake
2017-06-09 15:20 ` [Qemu-devel] [PATCH 2/2] qobject: Catch another straggler for use of qdict_put_str() Eric Blake
2017-06-11 12:40 ` Max Reitz
2017-06-11 21:28 ` [Qemu-devel] [Qemu-block] " Alberto Garcia
2017-07-12 13:35 ` [Qemu-devel] [PATCH 0/2] qobject coccinelle followups Michael Tokarev
2017-07-12 13:56 ` Eric Blake
2017-07-12 15:48 ` Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170609152017.7286-2-eblake@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).