diff options
Diffstat (limited to 'virt/kvm')
-rw-r--r-- | virt/kvm/kvm_main.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 470e30520fe8..415fe816fc15 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c | |||
@@ -784,15 +784,10 @@ int __kvm_set_memory_region(struct kvm *kvm, | |||
784 | int lpages; | 784 | int lpages; |
785 | int level = i + 2; | 785 | int level = i + 2; |
786 | 786 | ||
787 | /* Avoid unused variable warning if no large pages */ | ||
788 | (void)level; | ||
789 | |||
790 | if (new.lpage_info[i]) | 787 | if (new.lpage_info[i]) |
791 | continue; | 788 | continue; |
792 | 789 | ||
793 | lpages = 1 + ((base_gfn + npages - 1) | 790 | lpages = gfn_to_index(base_gfn + npages - 1, base_gfn, level) + 1; |
794 | >> KVM_HPAGE_GFN_SHIFT(level)); | ||
795 | lpages -= base_gfn >> KVM_HPAGE_GFN_SHIFT(level); | ||
796 | 791 | ||
797 | new.lpage_info[i] = vzalloc(lpages * sizeof(*new.lpage_info[i])); | 792 | new.lpage_info[i] = vzalloc(lpages * sizeof(*new.lpage_info[i])); |
798 | 793 | ||