public inbox for qemu-devel@nongnu.org
 help / color / mirror / Atom feed
From: Bernhard Beschow <shentey@gmail.com>
To: "Matyáš Bobek" <matyas.bobek@gmail.com>,
	qemu-devel@nongnu.org, "Matyas Bobek" <bobekmat@fel.cvut.cz>,
	"Pavel Pisa" <pisa@fel.cvut.cz>
Cc: qemu-arm@nongnu.org, Marc Kleine-Budde <mkl@pengutronix.de>,
	Oliver Hartkopp <socketcan@hartkopp.net>,
	Nikita Ostrenkov <n.ostrenkov@gmail.com>,
	Peter Maydell <peter.maydell@linaro.org>
Subject: Re: [PATCH v2 1/7] hw/arm/sabrelite: Open code DEFINE_MACHINE_ARM
Date: Tue, 24 Mar 2026 20:58:20 +0000	[thread overview]
Message-ID: <8C7E8510-66CE-4AA2-ADAC-F7549D04A16B@gmail.com> (raw)
In-Reply-To: <0528e7cd5cff7ce171b0aad0093a5e77e07c139a.1773866323.git.matyas.bobek@gmail.com>

Am 19. März 2026 19:13:08 UTC schrieb "Matyáš Bobek" <matyas.bobek@gmail.com>:
>Open code the DEFINE_MACHINE_ARM macro in preparation of creating
>SabreliteMachineState class. The name field in TypeInfo initializator
>is left as string literal since the macro would expand into this.
>
>Signed-off-by: Matyáš Bobek <matyas.bobek@gmail.com>
>---
> hw/arm/sabrelite.c | 23 ++++++++++++++++++++++-
> 1 file changed, 22 insertions(+), 1 deletion(-)
>
>diff --git a/hw/arm/sabrelite.c b/hw/arm/sabrelite.c
>index db5669c5c2..40ee8196ac 100644
>--- a/hw/arm/sabrelite.c
>+++ b/hw/arm/sabrelite.c
>@@ -114,4 +114,25 @@ static void sabrelite_machine_init(MachineClass *mc)
>     mc->auto_create_sdcard = true;
> }
> 
>-DEFINE_MACHINE_ARM("sabrelite", sabrelite_machine_init)
>+static void sabrelite_machine_class_init(ObjectClass *oc, const void *data)
>+{
>+    MachineClass *mc = MACHINE_CLASS(oc);
>+
>+    sabrelite_machine_init(mc);
>+}

Yes, this separation of concerns looks cleaner!

Since this function will be merged with sabrelite_machine_init() in the next commit, let's merge the two functions here. This avoids the intermediate function and makes the next commit easier to comprehend.

>+
>+static const TypeInfo sabrelite_machine_init_typeinfo = {
>+    .name          = MACHINE_TYPE_NAME("sabrelite"),
>+    .parent        = TYPE_MACHINE,
>+    .class_init    = sabrelite_machine_class_init,
>+    .instance_size = sizeof(MachineState),
>+    .abstract      = false,
>+    .interfaces    = arm_machine_interfaces,
>+};
>+
>+static void sabrelite_machine_init_register_types(void)
>+{
>+    type_register_static(&sabrelite_machine_init_typeinfo);
>+}
>+
>+type_init(sabrelite_machine_init_register_types)

With the above:
Reviewed-by: Bernhard Beschow <shentey@gmail.com>


  reply	other threads:[~2026-03-24 20:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-19 19:13 [PATCH v2 0/7] hw/arm/sabrelite: Add FlexCAN support Matyáš Bobek
2026-03-19 19:13 ` [PATCH v2 1/7] hw/arm/sabrelite: Open code DEFINE_MACHINE_ARM Matyáš Bobek
2026-03-24 20:58   ` Bernhard Beschow [this message]
2026-03-19 19:13 ` [PATCH v2 2/7] hw/arm/sabrelite: Introduce class SabreliteMachineState Matyáš Bobek
2026-03-24 11:11   ` Bernhard Beschow
2026-03-19 19:13 ` [PATCH v2 3/7] hw/misc/imx6_ccm: Add PLL3 and CAN clock Matyáš Bobek
2026-03-19 19:13 ` [PATCH v2 4/7] hw/net/can/flexcan: NXP FlexCAN core emulation Matyáš Bobek
2026-03-21 12:16   ` Pavel Pisa
2026-03-19 19:13 ` [PATCH v2 5/7] hw/arm: Plug FlexCAN into FSL_IMX6 and Sabrelite Matyáš Bobek
2026-03-19 19:13 ` [PATCH v2 6/7] tests: Add qtests for FlexCAN Matyáš Bobek
2026-03-19 19:13 ` [PATCH v2 7/7] docs/arm/sabrelite: Mention FlexCAN support Matyáš Bobek
2026-03-19 19:37 ` [PATCH v2 0/7] hw/arm/sabrelite: Add " Pavel Pisa

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=8C7E8510-66CE-4AA2-ADAC-F7549D04A16B@gmail.com \
    --to=shentey@gmail.com \
    --cc=bobekmat@fel.cvut.cz \
    --cc=matyas.bobek@gmail.com \
    --cc=mkl@pengutronix.de \
    --cc=n.ostrenkov@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=pisa@fel.cvut.cz \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=socketcan@hartkopp.net \
    /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