Skip to content

Commit 5f39693

Browse files
committed
system: Inline machine_containers[] in qemu_create_machine_containers()
Only qemu_create_machine_containers() uses the machine_containers[] array, restrict the scope to this single user. Signed-off-by: Philippe Mathieu-Daudé <[email protected]> Acked-by: Peter Xu <[email protected]> Reviewed-by: Richard Henderson <[email protected]> Message-Id: <[email protected]>
1 parent bc4e752 commit 5f39693

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

system/vl.c

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2113,18 +2113,16 @@ static void parse_memory_options(void)
21132113
loc_pop(&loc);
21142114
}
21152115

2116-
static const char *const machine_containers[] = {
2117-
"unattached",
2118-
"peripheral",
2119-
"peripheral-anon"
2120-
};
2121-
21222116
static void qemu_create_machine_containers(Object *machine)
21232117
{
2124-
int i;
2118+
static const char *const containers[] = {
2119+
"unattached",
2120+
"peripheral",
2121+
"peripheral-anon",
2122+
};
21252123

2126-
for (i = 0; i < ARRAY_SIZE(machine_containers); i++) {
2127-
object_property_add_new_container(machine, machine_containers[i]);
2124+
for (unsigned i = 0; i < ARRAY_SIZE(containers); i++) {
2125+
object_property_add_new_container(machine, containers[i]);
21282126
}
21292127
}
21302128

0 commit comments

Comments
 (0)