Skip to content

Commit

Permalink
KVM: emulator: cleanup decode_register_operand() a bit
Browse files Browse the repository at this point in the history
Make code shorter.

Reviewed-by: Paolo Bonzini <[email protected]>
Signed-off-by: Gleb Natapov <[email protected]>
  • Loading branch information
Gleb Natapov committed Nov 5, 2013
1 parent aa9ac1a commit 6d4d85e
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions arch/x86/kvm/emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1045,13 +1045,9 @@ static void decode_register_operand(struct x86_emulate_ctxt *ctxt,
}

op->type = OP_REG;
if (ctxt->d & ByteOp) {
op->addr.reg = decode_register(ctxt, reg, true);
op->bytes = 1;
} else {
op->addr.reg = decode_register(ctxt, reg, false);
op->bytes = ctxt->op_bytes;
}
op->bytes = (ctxt->d & ByteOp) ? 1 : ctxt->op_bytes;
op->addr.reg = decode_register(ctxt, reg, ctxt->d & ByteOp);

fetch_register_operand(op);
op->orig_val = op->val;
}
Expand Down

0 comments on commit 6d4d85e

Please sign in to comment.