qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/5] hw/ppc/e500: Declare CPU QOM types using DEFINE_TYPES()


From: Daniel Henrique Barboza
Subject: Re: [PATCH 2/5] hw/ppc/e500: Declare CPU QOM types using DEFINE_TYPES() macro
Date: Tue, 31 Oct 2023 18:01:13 -0300
User-agent: Mozilla Thunderbird



On 10/30/23 11:39, Philippe Mathieu-Daudé wrote:
When multiple QOM types are registered in the same file,
it is simpler to use the the DEFINE_TYPES() macro. In
particular because type array declared with such macro
are easier to review.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---

Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>

I'm going to do that for each file I modify, so eventually
we'll get all converted.
---
  hw/ppc/ppce500_spin.c | 21 +++++++++------------
  1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/hw/ppc/ppce500_spin.c b/hw/ppc/ppce500_spin.c
index bbce63e8a4..e3608d8c16 100644
--- a/hw/ppc/ppce500_spin.c
+++ b/hw/ppc/ppce500_spin.c
@@ -195,17 +195,14 @@ static void ppce500_spin_class_init(ObjectClass *klass, 
void *data)
      dc->reset = spin_reset;
  }
-static const TypeInfo ppce500_spin_info = {
-    .name          = TYPE_E500_SPIN,
-    .parent        = TYPE_SYS_BUS_DEVICE,
-    .instance_size = sizeof(SpinState),
-    .instance_init = ppce500_spin_initfn,
-    .class_init    = ppce500_spin_class_init,
+static const TypeInfo ppce500_spin_types[] = {
+    {
+        .name           = TYPE_E500_SPIN,
+        .parent         = TYPE_SYS_BUS_DEVICE,
+        .instance_size  = sizeof(SpinState),
+        .instance_init  = ppce500_spin_initfn,
+        .class_init     = ppce500_spin_class_init,
+    },
  };
-static void ppce500_spin_register_types(void)
-{
-    type_register_static(&ppce500_spin_info);
-}
-
-type_init(ppce500_spin_register_types)
+DEFINE_TYPES(ppce500_spin_types)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]