Patchwork [15/17] target-i386: cpu_x86_init(): eliminate extra 'def1' variable

login
register
mail settings
Submitter Eduardo Habkost
Date Nov. 12, 2012, 9:39 p.m.
Message ID <1352756342-13716-16-git-send-email-ehabkost@redhat.com>
Download mbox | patch
Permalink /patch/198483/
State New
Headers show

Comments

Eduardo Habkost - Nov. 12, 2012, 9:39 p.m.
Just use '&def' where a pointer to the under-construction
X86CPUDefinition struct is being used.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 target-i386/cpu.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Patch

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 57acf3a..9b8e480 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1526,19 +1526,19 @@  X86CPU *cpu_x86_init(const char *cpu_string)
     X86CPU *cpu;
     CPUX86State *env;
     Error *error = NULL;
-    X86CPUDefinition def1, *def = &def1;
+    X86CPUDefinition def;
 
     cpu = X86_CPU(object_new(TYPE_X86_CPU));
     env = &cpu->env;
     env->cpu_model_str = cpu_string;
 
-    memset(def, 0, sizeof(*def));
+    memset(&def, 0, sizeof(def));
 
-    if (cpu_x86_find_by_name(def, cpu_string, &error) < 0) {
+    if (cpu_x86_find_by_name(&def, cpu_string, &error) < 0) {
         goto error;
     }
 
-    if (cpudef_2_x86_cpu(cpu, def, &error) < 0) {
+    if (cpudef_2_x86_cpu(cpu, &def, &error) < 0) {
         goto error;
     }