Repository navigation
Commit 4d66623
KVM: x86: remove check on nr_mmu_pages in kvm_arch_commit_memory_region()
* nr_mmu_pages would be non-zero only if kvm->arch.n_requested_mmu_pages is
non-zero.
* nr_mmu_pages is always non-zero, since kvm_mmu_calculate_mmu_pages()
never return zero.
Based on these two reasons, we can merge the two *if* clause and use the
return value from kvm_mmu_calculate_mmu_pages() directly. This simplify
the code and also eliminate the possibility for reader to believe
nr_mmu_pages would be zero.
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Reviewed-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>1 parent 711eff3 commit 4d66623
3 files changed
Lines changed: 4 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1254 | 1254 | | |
1255 | 1255 | | |
1256 | 1256 | | |
1257 | | - | |
| 1257 | + | |
1258 | 1258 | | |
1259 | 1259 | | |
1260 | 1260 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6028 | 6028 | | |
6029 | 6029 | | |
6030 | 6030 | | |
6031 | | - | |
| 6031 | + | |
6032 | 6032 | | |
6033 | 6033 | | |
6034 | 6034 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9429 | 9429 | | |
9430 | 9430 | | |
9431 | 9431 | | |
9432 | | - | |
9433 | | - | |
9434 | 9432 | | |
9435 | | - | |
9436 | | - | |
9437 | | - | |
9438 | | - | |
| 9433 | + | |
| 9434 | + | |
9439 | 9435 | | |
9440 | 9436 | | |
9441 | 9437 | | |
| |||
0 commit comments