Commit 5a38b6e6 authored by Igor Mammedov's avatar Igor Mammedov Committed by Paolo Bonzini

kvm: update_memslots: drop not needed check for the same number of pages

if number of pages haven't changed sorting algorithm
will do nothing, so there is no need to do extra check
to avoid entering sorting logic.
Signed-off-by: default avatarIgor Mammedov <imammedo@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 45c3094a
...@@ -679,7 +679,6 @@ static void update_memslots(struct kvm_memslots *slots, ...@@ -679,7 +679,6 @@ static void update_memslots(struct kvm_memslots *slots,
struct kvm_memory_slot *mslots = slots->memslots; struct kvm_memory_slot *mslots = slots->memslots;
WARN_ON(mslots[i].id != id); WARN_ON(mslots[i].id != id);
if (new->npages != mslots[i].npages) {
if (new->npages < mslots[i].npages) { if (new->npages < mslots[i].npages) {
while (i < KVM_MEM_SLOTS_NUM - 1 && while (i < KVM_MEM_SLOTS_NUM - 1 &&
new->npages < mslots[i + 1].npages) { new->npages < mslots[i + 1].npages) {
...@@ -695,7 +694,6 @@ static void update_memslots(struct kvm_memslots *slots, ...@@ -695,7 +694,6 @@ static void update_memslots(struct kvm_memslots *slots,
i--; i--;
} }
} }
}
mslots[i] = *new; mslots[i] = *new;
slots->id_to_index[mslots[i].id] = i; slots->id_to_index[mslots[i].id] = i;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment