diff mbox series

[3/6] memory: Have cpu_address_space_init() use address_space_create()

Message ID 20210819142039.2825366-4-philmd@redhat.com (mailing list archive)
State New, archived
Headers show
Series memory: Introduce address_space_create(), re-use &address_space_memory | expand

Commit Message

Philippe Mathieu-Daudé Aug. 19, 2021, 2:20 p.m. UTC
Replace g_new0() + address_space_init() by address_space_create().

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 softmmu/physmem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/softmmu/physmem.c b/softmmu/physmem.c
index 3c1912a1a07..cd8b670a731 100644
--- a/softmmu/physmem.c
+++ b/softmmu/physmem.c
@@ -727,12 +727,12 @@  void cpu_address_space_init(CPUState *cpu, int asidx,
                             const char *prefix, MemoryRegion *mr)
 {
     CPUAddressSpace *newas;
-    AddressSpace *as = g_new0(AddressSpace, 1);
+    AddressSpace *as;
     char *as_name;
 
     assert(mr);
     as_name = g_strdup_printf("%s-%d", prefix, cpu->cpu_index);
-    address_space_init(as, mr, as_name);
+    as = address_space_create(mr, as_name);
     g_free(as_name);
 
     /* Target code should have set num_ases before calling us */