[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 11/11] system: Inline machine_containers[] in qemu_create_machine_
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 11/11] system: Inline machine_containers[] in qemu_create_machine_containers() |
Date: |
Thu, 9 Jan 2025 18:19:48 +0100 |
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>
Acked-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250102211800.79235-9-philmd@linaro.org>
---
system/vl.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/system/vl.c b/system/vl.c
index ed1623b26b9..be029c52ef8 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -2113,18 +2113,16 @@ 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 containers[] = {
+ "unattached",
+ "peripheral",
+ "peripheral-anon",
+ };
- for (i = 0; i < ARRAY_SIZE(machine_containers); i++) {
- object_property_add_new_container(machine, machine_containers[i]);
+ for (unsigned i = 0; i < ARRAY_SIZE(containers); i++) {
+ object_property_add_new_container(machine, containers[i]);
}
}
--
2.47.1
- [PULL 01/11] hw/pci: Use -1 as the default value for rombar, (continued)
- [PULL 01/11] hw/pci: Use -1 as the default value for rombar, Philippe Mathieu-Daudé, 2025/01/09
- [PULL 02/11] qdev: Remove opts member, Philippe Mathieu-Daudé, 2025/01/09
- [PULL 03/11] qdev: Implement qdev_create_fake_machine() for user emulation, Philippe Mathieu-Daudé, 2025/01/09
- [PULL 04/11] qdev: Make qdev_get_machine() not use container_get(), Philippe Mathieu-Daudé, 2025/01/09
- [PULL 05/11] qdev: Add machine_get_container(), Philippe Mathieu-Daudé, 2025/01/09
- [PULL 06/11] qdev: Use machine_get_container(), Philippe Mathieu-Daudé, 2025/01/09
- [PULL 07/11] qom: Add object_get_container(), Philippe Mathieu-Daudé, 2025/01/09
- [PULL 08/11] qom: Use object_get_container(), Philippe Mathieu-Daudé, 2025/01/09
- [PULL 09/11] qom: Remove container_get(), Philippe Mathieu-Daudé, 2025/01/09
- [PULL 10/11] qom: remove unused InterfaceInfo::concrete_class field, Philippe Mathieu-Daudé, 2025/01/09
- [PULL 11/11] system: Inline machine_containers[] in qemu_create_machine_containers(),
Philippe Mathieu-Daudé <=