[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/28] hw/intc/loongson_ipi: Declare QOM types using DEFINE_TYPES(
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 05/28] hw/intc/loongson_ipi: Declare QOM types using DEFINE_TYPES() macro |
Date: |
Tue, 23 Jul 2024 22:38:32 +0200 |
When multiple QOM types are registered in the same file,
it is simpler to use the the DEFINE_TYPES() macro. Replace
the type_init() / type_register_static() combination.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Acked-by: Song Gao <gaosong@loongson.cn>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Tested-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Message-Id: <20240718133312.10324-2-philmd@linaro.org>
---
hw/intc/loongson_ipi.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/hw/intc/loongson_ipi.c b/hw/intc/loongson_ipi.c
index 4013f81745e..682cec96f3f 100644
--- a/hw/intc/loongson_ipi.c
+++ b/hw/intc/loongson_ipi.c
@@ -365,16 +365,13 @@ static void loongson_ipi_class_init(ObjectClass *klass,
void *data)
dc->vmsd = &vmstate_loongson_ipi;
}
-static const TypeInfo loongson_ipi_info = {
- .name = TYPE_LOONGSON_IPI,
- .parent = TYPE_SYS_BUS_DEVICE,
- .instance_size = sizeof(LoongsonIPI),
- .class_init = loongson_ipi_class_init,
+static const TypeInfo loongson_ipi_types[] = {
+ {
+ .name = TYPE_LOONGSON_IPI,
+ .parent = TYPE_SYS_BUS_DEVICE,
+ .instance_size = sizeof(LoongsonIPI),
+ .class_init = loongson_ipi_class_init,
+ }
};
-static void loongson_ipi_register_types(void)
-{
- type_register_static(&loongson_ipi_info);
-}
-
-type_init(loongson_ipi_register_types)
+DEFINE_TYPES(loongson_ipi_types)
--
2.41.0
- [PULL 00/28] Misc HW+ patches for 2024-07-23, Philippe Mathieu-Daudé, 2024/07/23
- [PULL 01/28] accel: Restrict probe_access*() functions to TCG, Philippe Mathieu-Daudé, 2024/07/23
- [PULL 02/28] hw/i386/intel_iommu: Extract device IOTLB invalidation logic, Philippe Mathieu-Daudé, 2024/07/23
- [PULL 03/28] hw/intc/loongson_ipi: Access memory in little endian, Philippe Mathieu-Daudé, 2024/07/23
- [PULL 04/28] hw/intc/loongson_ipi: Fix resource leak, Philippe Mathieu-Daudé, 2024/07/23
- [PULL 05/28] hw/intc/loongson_ipi: Declare QOM types using DEFINE_TYPES() macro,
Philippe Mathieu-Daudé <=
- [PULL 06/28] docs: Correct Loongarch -> LoongArch, Philippe Mathieu-Daudé, 2024/07/23
- [PULL 07/28] docs/interop/firmware.json: add new enum FirmwareFormat, Philippe Mathieu-Daudé, 2024/07/23
- [PULL 08/28] docs/interop/firmware.json: add new enum FirmwareArchitecture, Philippe Mathieu-Daudé, 2024/07/23
- [PULL 09/28] docs/interop/firmware.json: convert "Example" section, Philippe Mathieu-Daudé, 2024/07/23
- [PULL 10/28] hw/i2c/mpc_i2c: Fix mmio region size, Philippe Mathieu-Daudé, 2024/07/23
- [PULL 11/28] hw/mips/loongson3_virt: remove useless type cast, Philippe Mathieu-Daudé, 2024/07/23
- [PULL 12/28] util/range: Make ranges_overlap() return bool, Philippe Mathieu-Daudé, 2024/07/23
- [PULL 15/28] system/memory_mapping: make range overlap check more readable, Philippe Mathieu-Daudé, 2024/07/23
- [PULL 14/28] sparc/ldst_helper: make range overlap check more readable, Philippe Mathieu-Daudé, 2024/07/23
- [PULL 13/28] cxl/mailbox: make range overlap check more readable, Philippe Mathieu-Daudé, 2024/07/23