]> git.baikalelectronics.ru Git - kernel.git/commit
kvm: x86: vmx: avoid returning bool to distinguish success from error
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 4 Nov 2014 17:31:19 +0000 (18:31 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 7 Nov 2014 14:44:00 +0000 (15:44 +0100)
commit4f9bab07bbb2e0ee223527e01fa22a979b96b1f1
treeb001c08e23ea5a86c3b96ad6e64b36f1c2d63a1b
parent6d31b7b0e6f7ce3c6cc59c42ffbc06437ed8fe5c
kvm: x86: vmx: avoid returning bool to distinguish success from error

Return a negative error code instead, and WARN() when we should be covering
the entire 2-bit space of vmcs_field_type's return value.  For increased
robustness, add a BUILD_BUG_ON checking the range of vmcs_field_to_offset.

Suggested-by: Tiejun Chen <tiejun.chen@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx.c