summary refs log tree commit diff stats
path: root/include/qapi/qmp/qnull.h
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2018-04-19 17:01:44 +0200
committerMarkus Armbruster <armbru@redhat.com>2018-05-04 08:27:53 +0200
commitf5a74a5a50387c6f980b2e2f94f062487a1826da (patch)
treeeefbe4d2f8bb0f889c9643d140fd702f131c4fd0 /include/qapi/qmp/qnull.h
parentcb3e7f08aeaab0ab13e629ce8496dca150a449ba (diff)
downloadfocaccia-qemu-f5a74a5a50387c6f980b2e2f94f062487a1826da.tar.gz
focaccia-qemu-f5a74a5a50387c6f980b2e2f94f062487a1826da.zip
qobject: Modify qobject_ref() to return obj
For convenience and clarity, make it possible to call qobject_ref() at
the time when the reference is associated with a variable, or
argument, by making qobject_ref() return the same pointer as given.
Use that to simplify the callers.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20180419150145.24795-5-marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Useless change to qobject_ref_impl() dropped, commit message improved
slightly]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'include/qapi/qmp/qnull.h')
-rw-r--r--include/qapi/qmp/qnull.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/include/qapi/qmp/qnull.h b/include/qapi/qmp/qnull.h
index 75b29c6a39..c1426882c5 100644
--- a/include/qapi/qmp/qnull.h
+++ b/include/qapi/qmp/qnull.h
@@ -23,8 +23,7 @@ extern QNull qnull_;
 
 static inline QNull *qnull(void)
 {
-    qobject_ref(&qnull_);
-    return &qnull_;
+    return qobject_ref(&qnull_);
 }
 
 bool qnull_is_equal(const QObject *x, const QObject *y);