diff options
author | Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> | 2013-02-05 07:26:54 (GMT) |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2013-02-07 00:42:08 (GMT) |
commit | 55dd98c3a81e243447d5fbf496fa8b909ef3b7f6 (patch) | |
tree | 3751b699f2ab8de6cbcc51b79f3671d2a0f0e4ac /arch | |
parent | caf6900f2d8aaebe404c976753f6813ccd31d95e (diff) | |
download | linux-fsl-qoriq-55dd98c3a81e243447d5fbf496fa8b909ef3b7f6.tar.xz |
KVM: MMU: cleanup mapping-level
Use min() to cleanup mapping_level
Reviewed-by: Gleb Natapov <gleb@redhat.com>
Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kvm/mmu.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 2a8d99a..5356d8d 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -832,8 +832,7 @@ static int mapping_level(struct kvm_vcpu *vcpu, gfn_t large_gfn) if (host_level == PT_PAGE_TABLE_LEVEL) return host_level; - max_level = kvm_x86_ops->get_lpage_level() < host_level ? - kvm_x86_ops->get_lpage_level() : host_level; + max_level = min(kvm_x86_ops->get_lpage_level(), host_level); for (level = PT_DIRECTORY_LEVEL; level <= max_level; ++level) if (has_wrprotected_page(vcpu->kvm, large_gfn, level)) |