From: Eric Blake <eblake@redhat.com>
To: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
Cc: mdroth@linux.vnet.ibm.com
Subject: Re: [PATCH for-5.1 1/5] qobject: Clean up QLIST_FOREACH_ENTRY()
Date: Wed, 15 Apr 2020 07:25:42 -0500 [thread overview]
Message-ID: <2dfbc0f3-b186-9c19-4eec-96b64048ffb3@redhat.com> (raw)
In-Reply-To: <20200415083048.14339-2-armbru@redhat.com>
On 4/15/20 3:30 AM, Markus Armbruster wrote:
> QLIST_FOREACH_ENTRY() traverses a tail queue manually. Use
> QTAILQ_FIRST() and QTAILQ_NEXT() instead.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
> include/qapi/qmp/qlist.h | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
Reviewed-by: Eric Blake <eblake@redhat.com>
> diff --git a/include/qapi/qmp/qlist.h b/include/qapi/qmp/qlist.h
> index 8d2c32ca28..07ecae81e4 100644
> --- a/include/qapi/qmp/qlist.h
> +++ b/include/qapi/qmp/qlist.h
> @@ -34,10 +34,10 @@ void qlist_append_int(QList *qlist, int64_t value);
> void qlist_append_null(QList *qlist);
> void qlist_append_str(QList *qlist, const char *value);
>
> -#define QLIST_FOREACH_ENTRY(qlist, var) \
> - for ((var) = ((qlist)->head.tqh_first); \
> - (var); \
> - (var) = ((var)->next.tqe_next))
> +#define QLIST_FOREACH_ENTRY(qlist, var) \
> + for ((var) = QTAILQ_FIRST(&(qlist)->head); \
> + (var); \
> + (var) = QTAILQ_NEXT((var), next))
>
> static inline QObject *qlist_entry_obj(const QListEntry *entry)
> {
>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
next prev parent reply other threads:[~2020-04-15 12:26 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-15 8:30 [PATCH for-5.1 0/5] qobject: Minor spring cleaning Markus Armbruster
2020-04-15 8:30 ` [PATCH for-5.1 1/5] qobject: Clean up QLIST_FOREACH_ENTRY() Markus Armbruster
2020-04-15 12:25 ` Eric Blake [this message]
2020-04-15 8:30 ` [PATCH for-5.1 2/5] qobject: Factor out helper json_pretty_newline() Markus Armbruster
2020-04-15 12:28 ` Eric Blake
2020-04-15 14:46 ` Markus Armbruster
2020-04-15 8:30 ` [PATCH for-5.1 3/5] qobject: Eliminate qlist_iter(), use QLIST_FOREACH_ENTRY() instead Markus Armbruster
2020-04-15 12:31 ` Eric Blake
2020-04-15 8:30 ` [PATCH for-5.1 4/5] qobject: Eliminate qdict_iter(), use qdict_first(), qdict_next() Markus Armbruster
2020-04-15 12:34 ` Eric Blake
2020-04-15 14:48 ` Markus Armbruster
2020-04-15 8:30 ` [PATCH for-5.1 5/5] qemu-option: Clean up after the previous commit Markus Armbruster
2020-04-15 12:35 ` Eric Blake
2020-04-29 7:46 ` [PATCH for-5.1 0/5] qobject: Minor spring cleaning 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=2dfbc0f3-b186-9c19-4eec-96b64048ffb3@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=qemu-devel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.