diff options
author | Philippe Mathieu-Daudé <philmd@linaro.org> | 2025-01-25 18:24:39 +0100 |
---|---|---|
committer | Philippe Mathieu-Daudé <philmd@linaro.org> | 2025-02-16 14:25:07 +0100 |
commit | d4194e19cc202774251ae03a1658077fd954797f (patch) | |
tree | 55f5349d7b15e6f6c9daa2dfa7a6588af69e6185 | |
parent | 0d2d00e57a55d3d8205923e60c2553d83d288ebb (diff) | |
download | qemu-d4194e19cc202774251ae03a1658077fd954797f.zip qemu-d4194e19cc202774251ae03a1658077fd954797f.tar.gz qemu-d4194e19cc202774251ae03a1658077fd954797f.tar.bz2 |
hw/sysbus: Use sizeof(BusState) in main_system_bus_create()
Rather than using the obscure system_bus_info.instance_size,
directly use sizeof(BusState).
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alexander Graf <graf@amazon.com>
Reviewed-by: Clément Mathieu--Drif<clement.mathieu--drif@eviden.com>
Message-Id: <20250125181343.59151-2-philmd@linaro.org>
-rw-r--r-- | hw/core/sysbus.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c index 9355849..f713bbf 100644 --- a/hw/core/sysbus.c +++ b/hw/core/sysbus.c @@ -323,8 +323,8 @@ static void main_system_bus_create(void) * assign main_system_bus before qbus_init() * in order to make "if (bus != sysbus_get_default())" work */ - main_system_bus = g_malloc0(system_bus_info.instance_size); - qbus_init(main_system_bus, system_bus_info.instance_size, + main_system_bus = g_new0(BusState, 1); + qbus_init(main_system_bus, sizeof(BusState), TYPE_SYSTEM_BUS, NULL, "main-system-bus"); OBJECT(main_system_bus)->free = g_free; } |