diff mbox series

[v2,01/10] softmmu/ioport: Move portio_list_init() in front of portio_list_add()

Message ID 20230126211740.66874-2-shentey@gmail.com (mailing list archive)
State New, archived
Headers show
Series Resolve isabus global | expand

Commit Message

Bernhard Beschow Jan. 26, 2023, 9:17 p.m. UTC
This is a preparation for the next patch to keep its diff smaller.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
 softmmu/ioport.c | 41 ++++++++++++++++++++---------------------
 1 file changed, 20 insertions(+), 21 deletions(-)
diff mbox series

Patch

diff --git a/softmmu/ioport.c b/softmmu/ioport.c
index cb8adb0b93..215344467b 100644
--- a/softmmu/ioport.c
+++ b/softmmu/ioport.c
@@ -113,27 +113,6 @@  uint32_t cpu_inl(uint32_t addr)
     return val;
 }
 
-void portio_list_init(PortioList *piolist,
-                      Object *owner,
-                      const MemoryRegionPortio *callbacks,
-                      void *opaque, const char *name)
-{
-    unsigned n = 0;
-
-    while (callbacks[n].size) {
-        ++n;
-    }
-
-    piolist->ports = callbacks;
-    piolist->nr = 0;
-    piolist->regions = g_new0(MemoryRegion *, n);
-    piolist->address_space = NULL;
-    piolist->opaque = opaque;
-    piolist->owner = owner;
-    piolist->name = name;
-    piolist->flush_coalesced_mmio = false;
-}
-
 void portio_list_set_flush_coalesced(PortioList *piolist)
 {
     piolist->flush_coalesced_mmio = true;
@@ -250,6 +229,26 @@  static void portio_list_add_1(PortioList *piolist,
     ++piolist->nr;
 }
 
+void portio_list_init(PortioList *piolist, Object *owner,
+                      const MemoryRegionPortio *callbacks,
+                      void *opaque, const char *name)
+{
+    unsigned n = 0;
+
+    while (callbacks[n].size) {
+        ++n;
+    }
+
+    piolist->ports = callbacks;
+    piolist->nr = 0;
+    piolist->regions = g_new0(MemoryRegion *, n);
+    piolist->address_space = NULL;
+    piolist->opaque = opaque;
+    piolist->owner = owner;
+    piolist->name = name;
+    piolist->flush_coalesced_mmio = false;
+}
+
 void portio_list_add(PortioList *piolist,
                      MemoryRegion *address_space,
                      uint32_t start)