Re: [PATCH 01/15] KVM: selftests: Explicitly state indicies for vm_guest_mode_params array
From: Ben Gardon
Date: Wed Feb 10 2021 - 19:56:14 EST
On Wed, Feb 10, 2021 at 3:06 PM Sean Christopherson <seanjc@xxxxxxxxxx> wrote:
>
> Explicitly state the indices when populating vm_guest_mode_params to
> make it marginally easier to visualize what's going on.
>
> No functional change intended.
>
> Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
Reviewed-by: Ben Gardon <bgardon@xxxxxxxxxx>
> ---
> tools/testing/selftests/kvm/lib/kvm_util.c | 14 +++++++-------
> 1 file changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c
> index d787cb802b4a..960f4c5129ff 100644
> --- a/tools/testing/selftests/kvm/lib/kvm_util.c
> +++ b/tools/testing/selftests/kvm/lib/kvm_util.c
> @@ -154,13 +154,13 @@ _Static_assert(sizeof(vm_guest_mode_string)/sizeof(char *) == NUM_VM_MODES,
> "Missing new mode strings?");
>
> const struct vm_guest_mode_params vm_guest_mode_params[] = {
> - { 52, 48, 0x1000, 12 },
> - { 52, 48, 0x10000, 16 },
> - { 48, 48, 0x1000, 12 },
> - { 48, 48, 0x10000, 16 },
> - { 40, 48, 0x1000, 12 },
> - { 40, 48, 0x10000, 16 },
> - { 0, 0, 0x1000, 12 },
> + [VM_MODE_P52V48_4K] = { 52, 48, 0x1000, 12 },
> + [VM_MODE_P52V48_64K] = { 52, 48, 0x10000, 16 },
> + [VM_MODE_P48V48_4K] = { 48, 48, 0x1000, 12 },
> + [VM_MODE_P48V48_64K] = { 48, 48, 0x10000, 16 },
> + [VM_MODE_P40V48_4K] = { 40, 48, 0x1000, 12 },
> + [VM_MODE_P40V48_64K] = { 40, 48, 0x10000, 16 },
> + [VM_MODE_PXXV48_4K] = { 0, 0, 0x1000, 12 },
> };
> _Static_assert(sizeof(vm_guest_mode_params)/sizeof(struct vm_guest_mode_params) == NUM_VM_MODES,
> "Missing new mode params?");
> --
> 2.30.0.478.g8a0d178c01-goog
>