Re: [PATCH 2/3] KVM: emulator: cleanup decode_register_operand() a bit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Il 04/11/2013 14:52, Gleb Natapov ha scritto:
> Make code shorter.
> 
> Signed-off-by: Gleb Natapov <gleb@xxxxxxxxxx>
> ---
>  arch/x86/kvm/emulate.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
> index 0bd372f..07ffca0 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;
>  }
> 

Not sure I prefer the new code, but beauty is in the eye of the beholder. :)

Reviewed-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux