qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] hvf: Determine slot count from struct layout


From: Paolo Bonzini
Subject: Re: [PATCH] hvf: Determine slot count from struct layout
Date: Fri, 8 Oct 2021 19:18:45 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0

On 08/10/21 07:46, Alexander Graf wrote:
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 <agraf@csgraf.de>
---
  accel/hvf/hvf-accel-ops.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c
index 6cbd2c3f97..2b2c411076 100644
--- a/accel/hvf/hvf-accel-ops.c
+++ b/accel/hvf/hvf-accel-ops.c
@@ -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;


Queued, thanks.

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]