diff mbox series

[v3,10/10] qdev: Inline machine_containers[] in qemu_create_machine_containers()

Message ID 20250102151244.59357-11-philmd@linaro.org
State Superseded
Headers show
Series QOM: container_get() removal | expand

Commit Message

Philippe Mathieu-Daudé Jan. 2, 2025, 3:12 p.m. UTC
Only qemu_create_machine_containers() uses the
machine_containers[] array, restrict the scope
to this single user.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 system/vl.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/system/vl.c b/system/vl.c
index 933ad83a935..58e68b98d87 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -2114,17 +2114,15 @@  static void parse_memory_options(void)
     loc_pop(&loc);
 }
 
-static const char *const machine_containers[] = {
-    "unattached",
-    "peripheral",
-    "peripheral-anon"
-};
-
 static void qemu_create_machine_containers(Object *machine)
 {
-    int i;
+    static const char *const machine_containers[] = {
+        "unattached",
+        "peripheral",
+        "peripheral-anon"
+    };
 
-    for (i = 0; i < ARRAY_SIZE(machine_containers); i++) {
+    for (unsigned i = 0; i < ARRAY_SIZE(machine_containers); i++) {
         object_property_add_new_container(machine, machine_containers[i]);
     }
 }