From patchwork Wed Sep 7 13:41:37 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 1127552 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p87GYGwx031454 for ; Wed, 7 Sep 2011 16:34:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752277Ab1IGQcf (ORCPT ); Wed, 7 Sep 2011 12:32:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60359 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752060Ab1IGQ3d (ORCPT ); Wed, 7 Sep 2011 12:29:33 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p87GTXan032588 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 7 Sep 2011 12:29:33 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p87Dfgcb015614 for ; Wed, 7 Sep 2011 09:43:28 -0400 Received: from s01.tlv.redhat.com (s01.tlv.redhat.com [10.35.255.8]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id 2D3F7250B5B; Wed, 7 Sep 2011 16:41:42 +0300 (IDT) From: Avi Kivity To: Marcelo Tosatti , kvm@vger.kernel.org Subject: [PATCH 3/6] KVM: x86 emulator: simplify emulate_2op_cl() Date: Wed, 7 Sep 2011 16:41:37 +0300 Message-Id: <1315402900-8766-4-git-send-email-avi@redhat.com> In-Reply-To: <1315402900-8766-1-git-send-email-avi@redhat.com> References: <1315402900-8766-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 07 Sep 2011 16:34:22 +0000 (UTC) emulate_2op_cl() is always called with the same parameters. Simplify by passing just the emulation context. Signed-off-by: Avi Kivity --- arch/x86/kvm/emulate.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 1bc9e24..70c9f11 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -263,7 +263,7 @@ struct gprefix { __emulate_2op_nobyte(ctxt, _op, "w", "r", _LO32, "r", "", "r") /* Instruction has three operands and one operand is stored in ECX register */ -#define __emulate_2op_cl(_op, ctxt, _suffix, _type) \ +#define __emulate_2op_cl(ctxt, _op, _suffix, _type) \ do { \ unsigned long _tmp; \ _type _clv = (ctxt)->src2.val; \ @@ -287,13 +287,13 @@ struct gprefix { do { \ switch ((ctxt)->dst.bytes) { \ case 2: \ - __emulate_2op_cl(_op, ctxt, "w", u16); \ + __emulate_2op_cl(ctxt, _op, "w", u16); \ break; \ case 4: \ - __emulate_2op_cl(_op, ctxt, "l", u32); \ + __emulate_2op_cl(ctxt, _op, "l", u32); \ break; \ case 8: \ - ON64(__emulate_2op_cl(_op, ctxt, "q", ulong)); \ + ON64(__emulate_2op_cl(ctxt, _op, "q", ulong)); \ break; \ } \ } while (0)