KVM: selftests: memslot_perf_test: Consolidate loop conditions in prepare_vm()
authorGavin Shan <gshan@redhat.com>
Thu, 20 Oct 2022 07:12:05 +0000 (15:12 +0800)
committerMarc Zyngier <maz@kernel.org>
Thu, 10 Nov 2022 18:56:15 +0000 (18:56 +0000)
commit2aae5e6795e1407334bb849f96f11c9051b959e2
tree9996a69f01cbb3a1a5d3ae5445ae5d5ff75ffa69
parent3bfadb2325891d122771ce534336af531e93d7b2
KVM: selftests: memslot_perf_test: Consolidate loop conditions in prepare_vm()

There are two loops in prepare_vm(), which have different conditions.
'slot' is treated as meory slot index in the first loop, but index of
the host virtual address array in the second loop. It makes it a bit
hard to understand the code.

Change the usage of 'slot' in the second loop, to treat it as the
memory slot index either.

No functional change intended.

Signed-off-by: Gavin Shan <gshan@redhat.com>
Reviewed-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20221020071209.559062-3-gshan@redhat.com
tools/testing/selftests/kvm/memslot_perf_test.c