From: Eric Blake <eblake@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org, Michael Roth <mdroth@linux.vnet.ibm.com>
Subject: Re: [PATCH v2 5/7] qapi: Introduce QAPI_LIST_APPEND
Date: Tue, 17 Nov 2020 18:41:36 -0600 [thread overview]
Message-ID: <53efa18b-9fe2-fe38-a416-7a4f3ba6e07e@redhat.com> (raw)
In-Reply-To: <87blfw9mf1.fsf@dusky.pond.sub.org>
On 11/17/20 6:51 AM, Markus Armbruster wrote:
> Eric Blake <eblake@redhat.com> writes:
>
>> Similar to the existing QAPI_LIST_PREPEND, but designed for use where
>> we want to preserve insertion order. Callers will be added in
>> upcoming patches. Note the difference in signature: PREPEND takes
>> List*, APPEND takes List**.
>>
>> Signed-off-by: Eric Blake <eblake@redhat.com>
>> +#define QAPI_LIST_APPEND(tail, element) do { \
>> + *(tail) = g_malloc0(sizeof(**(tail))); \
>> + (*(tail))->value = (element); \
>> + (tail) = &(*tail)->next; \
Hmm; I'm inconsistent on whether to spell things '*tail' or '*(tail)'.
I don't think any of the callers converted in patches 6 or 7 care about
the difference, but for maximal copy-paste portability, the use of the
macro parameter should be surrounded by () anywhere that could otherwise
cause a mis-parse on some arbitrary expression with an operator at
higher precedence than unary * (hmm, the only such operators are all
suffix operators; so maybe the *(tail) is overkill...)
>
> Reviewed-by: Markus Armbruster <armbru@redhat.com>
>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
next prev parent reply other threads:[~2020-11-18 0:44 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-13 1:13 [PATCH v2 0/7] Common macros for QAPI list growth Eric Blake
2020-11-13 1:13 ` [PATCH v2 1/7 for-5.2?] net: Fix memory leak on error Eric Blake
2020-11-16 14:22 ` Markus Armbruster
2020-11-16 14:41 ` Eric Blake
2020-11-13 1:13 ` [PATCH v2 2/7] rocker: Revamp fp_port_get_info Eric Blake
2020-11-17 9:27 ` Markus Armbruster
2020-11-13 1:13 ` [PATCH v2 3/7] migration: Refactor migrate_cap_add Eric Blake
2020-11-17 9:45 ` Markus Armbruster
2020-11-13 1:13 ` [PATCH v2 4/7] qapi: Use QAPI_LIST_PREPEND() where possible Eric Blake
2020-11-17 10:20 ` Markus Armbruster
2020-11-17 11:45 ` Stefan Hajnoczi
2020-11-13 1:13 ` [PATCH v2 5/7] qapi: Introduce QAPI_LIST_APPEND Eric Blake
2020-11-17 12:51 ` Markus Armbruster
2020-11-18 0:41 ` Eric Blake [this message]
2020-11-18 6:21 ` Markus Armbruster
2020-11-13 1:13 ` [PATCH v2 6/7] qapi: Use QAPI_LIST_APPEND in trivial cases Eric Blake
2020-11-13 1:13 ` [PATCH v2 7/7] qapi: More complex uses of QAPI_LIST_APPEND Eric Blake
2020-11-13 19:39 ` Dr. David Alan Gilbert
2020-11-16 13:27 ` Eric Blake
2020-11-19 8:50 ` Markus Armbruster
2020-12-04 22:54 ` Eric Blake
2020-11-19 9:28 ` [PATCH v2 0/7] Common macros for QAPI list growth Markus Armbruster
2020-12-19 9:43 ` 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=53efa18b-9fe2-fe38-a416-7a4f3ba6e07e@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 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).