[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [PATCH v2] target/arm: Stop using variable length array i
From: |
Richard Henderson |
Subject: |
Re: [Qemu-arm] [PATCH v2] target/arm: Stop using variable length array in dc_zva |
Date: |
Fri, 3 May 2019 08:40:54 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 |
On 5/3/19 5:04 AM, Peter Maydell wrote:
> Currently the dc_zva helper function uses a variable length
> array. In fact we know (as the comment above remarks) that
> the length of this array is bounded because the architecture
> limits the block size and QEMU limits the target page size.
> Use a fixed array size and assert that we don't run off it.
>
> Signed-off-by: Peter Maydell <address@hidden>
> ---
> Changes v1->v2:
> * use ARRAY_SIZE() instead of sizeof()
> * add a comment to make it a bit clearer that the
> expected size of hostaddr[] is only 2 entries
> ---
> target/arm/helper.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
Reviewed-by: Richard Henderson <address@hidden>
r~