From: Markus Armbruster <armbru@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: qemu-devel@nongnu.org, "Markus Armbruster" <armbru@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Michael Roth" <michael.roth@amd.com>,
"Pierrick Bouvier" <pierrick.bouvier@oss.qualcomm.com>,
"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Elena Ufimtseva" <elena.ufimtseva@oracle.com>,
"Jagannathan Raman" <jag.raman@oracle.com>,
"Jonathan Cameron" <jic23@kernel.org>,
qemu-arm@nongnu.org, linux-cxl@vger.kernel.org
Subject: Re: [PATCH v5 45/62] include: add QEMU_REPEAT helper macro
Date: Mon, 19 Oct 2026 09:45:32 +0200 [thread overview]
Message-ID: <87fqy22kwz.fsf@pond.sub.org> (raw)
In-Reply-To: <20260911-qom-qapi-v5-45-7732a55b7760@redhat.com> ("Marc-André Lureau"'s message of "Fri, 11 Sep 2026 20:35:19 +0400")
Marc-André Lureau <marcandre.lureau@redhat.com> writes:
> Introduce a macro used in following commit, and convert a few existing
> candidates. Inspired by a similar macro in Linux kernel/trace/bpf_trace.c
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
[...]
> diff --git a/hw/remote/vfio-user-obj.c b/hw/remote/vfio-user-obj.c
> index 7e6819f670b5..84c3ff05cfb8 100644
> --- a/hw/remote/vfio-user-obj.c
> +++ b/hw/remote/vfio-user-obj.c
> @@ -496,22 +496,11 @@ static size_t vfu_object_bar_rw(PCIDevice *pci_dev, int pci_bar,
> buf, count, is_write); \
> } \
>
> -VFU_OBJECT_BAR_HANDLER(0)
> -VFU_OBJECT_BAR_HANDLER(1)
> -VFU_OBJECT_BAR_HANDLER(2)
> -VFU_OBJECT_BAR_HANDLER(3)
> -VFU_OBJECT_BAR_HANDLER(4)
> -VFU_OBJECT_BAR_HANDLER(5)
> -VFU_OBJECT_BAR_HANDLER(6)
> +QEMU_REPEAT(PCI_NUM_REGIONS, VFU_OBJECT_BAR_HANDLER)
>
> +#define VFU_OBJECT_BAR_HANDLER_PTR(BAR_NO) vfu_object_bar##BAR_NO##_handler,
scripts/checkpatch.pl
ERROR: Macros with complex values should be enclosed in parenthesis
False positive, I guess. Can't see offhand how to avoid it.
> static vfu_region_access_cb_t *vfu_object_bar_handlers[PCI_NUM_REGIONS] = {
> - &vfu_object_bar0_handler,
> - &vfu_object_bar1_handler,
> - &vfu_object_bar2_handler,
> - &vfu_object_bar3_handler,
> - &vfu_object_bar4_handler,
> - &vfu_object_bar5_handler,
> - &vfu_object_bar6_handler,
> + QEMU_REPEAT(PCI_NUM_REGIONS, VFU_OBJECT_BAR_HANDLER_PTR)
> };
>
> /**
[...]
next prev parent reply other threads:[~2026-10-19 8:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260911-qom-qapi-v5-0-7732a55b7760@redhat.com>
2026-09-11 16:34 ` [PATCH v5 21/62] arm/virt: convert OnOffAuto acpi property to QAPI-aware registration Marc-André Lureau
2026-09-11 16:35 ` [PATCH v5 34/62] hw/misc/xlnx-versal-trng: add missing getter for fips-fault-events Marc-André Lureau
2026-09-11 16:35 ` [PATCH v5 35/62] qom: convert scalar properties to QAPI-aware registration Marc-André Lureau
2026-10-19 7:41 ` Markus Armbruster
2026-09-11 16:35 ` [PATCH v5 44/62] hw/gpio/pca955x: use QAPI enums for led and pin properties Marc-André Lureau
2026-09-11 16:35 ` [PATCH v5 45/62] include: add QEMU_REPEAT helper macro Marc-André Lureau
2026-10-19 7:45 ` Markus Armbruster [this message]
2026-09-11 16:35 ` [PATCH v5 46/62] hw/gpio/pca955x: convert pin/led property to QAPI-aware enum Marc-André Lureau
2026-09-11 16:35 ` [PATCH v5 52/62] hw: convert device-local PropertyInfo definitions to use qapi_type Marc-André Lureau
2026-09-11 16:35 ` [PATCH v5 56/62] qdev: simplify DEFINE_PROP_ARRAY and remove generic array PropertyInfo Marc-André Lureau
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=87fqy22kwz.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=elena.ufimtseva@oracle.com \
--cc=jag.raman@oracle.com \
--cc=jic23@kernel.org \
--cc=linux-cxl@vger.kernel.org \
--cc=marcandre.lureau@redhat.com \
--cc=michael.roth@amd.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@oss.qualcomm.com \
--cc=pierrick.bouvier@oss.qualcomm.com \
--cc=qemu-arm@nongnu.org \
--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