summaryrefslogtreecommitdiff
path: root/arch/x86/kvm/emulate.c
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2013-11-04 15:52:42 +0200
committerGleb Natapov <gleb@redhat.com>2013-11-05 09:11:30 +0200
commit6d4d85ec5698a65165eb9af0ce0e508a7c757bac (patch)
tree1c0b5a89fc8722979d33e11ad84861d796dc241c /arch/x86/kvm/emulate.c
parentaa9ac1a6323d21065e121902fef4f1b6c07c37c7 (diff)
KVM: emulator: cleanup decode_register_operand() a bit
Make code shorter. Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Gleb Natapov <gleb@redhat.com>
Diffstat (limited to 'arch/x86/kvm/emulate.c')
-rw-r--r--arch/x86/kvm/emulate.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 0bd372f3c989..07ffca0a89e9 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -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;
}