[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [qom-cpu PATCH v2] target-i386: Don't declare variables in
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [qom-cpu PATCH v2] target-i386: Don't declare variables in the middle of blocks |
Date: |
Wed, 19 Feb 2014 16:39:21 -0300 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Some of my recent changes introduced variable declarations in the middle
of code blocks.
Fix the code so that it compiles without warnings when using
-Wdeclaration-after-statement.
Signed-off-by: Eduardo Habkost <address@hidden>
---
Changes v2:
* Rebased on top of qom-cpu
---
target-i386/cpu.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 5a530b5..9ff1062 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1143,6 +1143,7 @@ static void kvm_cpu_fill_host(X86CPUDefinition
*x86_cpu_def)
{
KVMState *s = kvm_state;
uint32_t eax = 0, ebx = 0, ecx = 0, edx = 0;
+ FeatureWord w;
assert(kvm_enabled());
@@ -1163,7 +1164,6 @@ static void kvm_cpu_fill_host(X86CPUDefinition
*x86_cpu_def)
cpu_x86_fill_model_id(x86_cpu_def->model_id);
- FeatureWord w;
for (w = 0; w < FEATURE_WORDS; w++) {
FeatureWordInfo *wi = &feature_word_info[w];
x86_cpu_def->features[w] =
@@ -1823,6 +1823,8 @@ static void x86_cpu_load_def(X86CPU *cpu, const char
*name, Error **errp)
{
CPUX86State *env = &cpu->env;
X86CPUDefinition def1, *def = &def1;
+ const char *vendor;
+ char host_vendor[CPUID_VENDOR_SZ + 1];
memset(def, 0, sizeof(*def));
@@ -1862,8 +1864,7 @@ static void x86_cpu_load_def(X86CPU *cpu, const char
*name, Error **errp)
* KVM's sysenter/syscall emulation in compatibility mode and
* when doing cross vendor migration
*/
- const char *vendor = def->vendor;
- char host_vendor[CPUID_VENDOR_SZ + 1];
+ vendor = def->vendor;
if (kvm_enabled()) {
uint32_t ebx = 0, ecx = 0, edx = 0;
host_cpuid(0, 0, NULL, &ebx, &ecx, &edx);
--
1.8.5.3
- [Qemu-devel] [PULL 05/16] target-i386: kvm_cpu_fill_host(): Set all feature words at end of function, (continued)
- [Qemu-devel] [PULL 05/16] target-i386: kvm_cpu_fill_host(): Set all feature words at end of function, Paolo Bonzini, 2014/02/03
- [Qemu-devel] [PULL 07/16] target-i386: kvm_check_features_against_host(): Kill feature word array, Paolo Bonzini, 2014/02/03
- [Qemu-devel] [PULL 12/16] kvm: make hyperv vapic assist page migratable, Paolo Bonzini, 2014/02/03
- [Qemu-devel] [PULL 16/16] target-i386: Move KVM default-vendor hack to instance_init, Paolo Bonzini, 2014/02/03
- Re: [Qemu-devel] [PULL 16/16] target-i386: Move KVM default-vendor hack to instance_init, Andreas Färber, 2014/02/08
- Re: [Qemu-devel] [PULL 16/16] target-i386: Move KVM default-vendor hack to instance_init, Paolo Bonzini, 2014/02/08
- Re: [Qemu-devel] [PULL 16/16] target-i386: Move KVM default-vendor hack to instance_init, Peter Maydell, 2014/02/08
- Re: [Qemu-devel] [PULL 16/16] target-i386: Move KVM default-vendor hack to instance_init, Peter Maydell, 2014/02/08
- Re: [Qemu-devel] [PULL 16/16] target-i386: Move KVM default-vendor hack to instance_init, Paolo Bonzini, 2014/02/09
- [Qemu-devel] [PATCH] target-i386: Don't declare variables in the middle of blocks, Eduardo Habkost, 2014/02/09
- [Qemu-devel] [qom-cpu PATCH v2] target-i386: Don't declare variables in the middle of blocks,
Eduardo Habkost <=
- Re: [Qemu-devel] [qom-cpu PATCH v2] target-i386: Don't declare variables in the middle of blocks, Andreas Färber, 2014/02/20
- Re: [Qemu-devel] [PULL 16/16] target-i386: Move KVM default-vendor hack to instance_init, Eduardo Habkost, 2014/02/09
- Re: [Qemu-devel] [PULL 16/16] target-i386: Move KVM default-vendor hack to instance_init, Andreas Färber, 2014/02/09
- Re: [Qemu-devel] [PULL 16/16] target-i386: Move KVM default-vendor hack to instance_init, Peter Maydell, 2014/02/09
- Re: [Qemu-devel] [PULL 16/16] target-i386: Move KVM default-vendor hack to instance_init, Andreas Färber, 2014/02/08
- Re: [Qemu-devel] [PULL 16/16] target-i386: Move KVM default-vendor hack to instance_init, Paolo Bonzini, 2014/02/09
Re: [Qemu-devel] [PULL 00/16] KVM changes for 2014-02-03, Peter Maydell, 2014/02/06