Skip to content

Commit

Permalink
KVM: VMX: Remove redundant test in vmx_set_efer()
Browse files Browse the repository at this point in the history
msr was tested above, so the second test is not needed.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r@
expression *x;
expression e;
identifier l;
@@

if (x == NULL || ...) {
    ... when forall
    return ...; }
... when != goto l;
    when != x = e
    when != &x
*x == NULL
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Avi Kivity <avi@redhat.com>
  • Loading branch information
Julia Lawall authored and Marcelo Tosatti committed Mar 1, 2010
1 parent 16fbb5e commit c45b4fd
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions arch/x86/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1602,8 +1602,6 @@ static void vmx_set_efer(struct kvm_vcpu *vcpu, u64 efer)
*/
vmx_load_host_state(to_vmx(vcpu));
vcpu->arch.efer = efer;
if (!msr)
return;
if (efer & EFER_LMA) {
vmcs_write32(VM_ENTRY_CONTROLS,
vmcs_read32(VM_ENTRY_CONTROLS) |
Expand Down

0 comments on commit c45b4fd

Please sign in to comment.