From patchwork Thu Oct 21 18:25:49 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 68765 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id EBBBCB6EFF for ; Fri, 22 Oct 2010 05:51:42 +1100 (EST) Received: from localhost ([127.0.0.1]:35386 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P90Em-00066J-86 for incoming@patchwork.ozlabs.org; Thu, 21 Oct 2010 14:51:40 -0400 Received: from [140.186.70.92] (port=33438 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P8zqm-0006sZ-01 for qemu-devel@nongnu.org; Thu, 21 Oct 2010 14:26:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P8zqj-0002HF-5x for qemu-devel@nongnu.org; Thu, 21 Oct 2010 14:26:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8163) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P8zqi-0002GM-VP for qemu-devel@nongnu.org; Thu, 21 Oct 2010 14:26:49 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o9LIQkIr009341 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 21 Oct 2010 14:26:46 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id o9LIQjY2015270; Thu, 21 Oct 2010 14:26:46 -0400 Received: from amt.cnet (vpn-8-132.rdu.redhat.com [10.11.8.132]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o9LIQiQ6031165; Thu, 21 Oct 2010 14:26:45 -0400 Received: from amt.cnet (localhost.localdomain [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 4D18E68A0A8; Thu, 21 Oct 2010 16:26:11 -0200 (BRST) Received: (from marcelo@localhost) by amt.cnet (8.14.4/8.14.4/Submit) id o9LIQ9AF030341; Thu, 21 Oct 2010 16:26:09 -0200 From: Marcelo Tosatti To: Anthony Liguori Date: Thu, 21 Oct 2010 16:25:49 -0200 Message-Id: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: Hidetoshi Seto , Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [Qemu-devel] [PATCH 3/7] Fix build on !KVM_CAP_MCE X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Hidetoshi Seto This patch removes following warnings: target-i386/kvm.c: In function 'kvm_put_msrs': target-i386/kvm.c:782: error: unused variable 'i' target-i386/kvm.c: In function 'kvm_get_msrs': target-i386/kvm.c:1083: error: label at end of compound statement Signed-off-by: Hidetoshi Seto Signed-off-by: Marcelo Tosatti --- target-i386/kvm.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 9144f74..587ee19 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -783,7 +783,7 @@ static int kvm_put_msrs(CPUState *env, int level) struct kvm_msr_entry entries[100]; } msr_data; struct kvm_msr_entry *msrs = msr_data.entries; - int i, n = 0; + int n = 0; kvm_msr_entry_set(&msrs[n++], MSR_IA32_SYSENTER_CS, env->sysenter_cs); kvm_msr_entry_set(&msrs[n++], MSR_IA32_SYSENTER_ESP, env->sysenter_esp); @@ -805,6 +805,7 @@ static int kvm_put_msrs(CPUState *env, int level) } #ifdef KVM_CAP_MCE if (env->mcg_cap) { + int i; if (level == KVM_PUT_RESET_STATE) kvm_msr_entry_set(&msrs[n++], MSR_MCG_STATUS, env->mcg_status); else if (level == KVM_PUT_FULL_STATE) { @@ -1089,9 +1090,9 @@ static int kvm_get_msrs(CPUState *env) if (msrs[i].index >= MSR_MC0_CTL && msrs[i].index < MSR_MC0_CTL + (env->mcg_cap & 0xff) * 4) { env->mce_banks[msrs[i].index - MSR_MC0_CTL] = msrs[i].data; - break; } #endif + break; } }