]> Git Repo - qemu.git/commitdiff
hvf: Determine slot count from struct layout
authorAlexander Graf <[email protected]>
Fri, 8 Oct 2021 05:46:16 +0000 (07:46 +0200)
committerPaolo Bonzini <[email protected]>
Wed, 13 Oct 2021 08:47:49 +0000 (10:47 +0200)
We can handle up to a static amount of memory slots, capped by the size of
an internal array.

Let's make sure that array size is the only source of truth for the number
of elements in that array.

Signed-off-by: Alexander Graf <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Message-Id: <20211008054616[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
accel/hvf/hvf-accel-ops.c

index 6cbd2c3f97e622b6074d7d562a0c356213d1ed20..2b2c411076d0b0ed434fb362d1a38fcf1f910497 100644 (file)
@@ -321,7 +321,7 @@ static int hvf_accel_init(MachineState *ms)
 
     s = g_new0(HVFState, 1);
 
-    s->num_slots = 32;
+    s->num_slots = ARRAY_SIZE(s->slots);
     for (x = 0; x < s->num_slots; ++x) {
         s->slots[x].size = 0;
         s->slots[x].slot_id = x;
This page took 0.024404 seconds and 4 git commands to generate.