Patchwork [RFC,03/19] i386: x86_def_t: rename 'flags' field

login
register
mail settings
Submitter Eduardo Habkost
Date Aug. 3, 2012, 2:59 a.m.
Message ID <1343962766-22024-4-git-send-email-ehabkost@redhat.com>
Download mbox | patch
Permalink /patch/174862/
State New
Headers show

Comments

Eduardo Habkost - Aug. 3, 2012, 2:59 a.m.
The field is being used for a single purpose: to indicate if the CPU
model is a builtin one. So, instead of an opaque and confusing 'flags'
field name, use a boolean 'is_builtin' field to indicate if the model is
a built-in one.

No behavior change, just a field rename.

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

Patch

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index d546534..1154a34 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -236,7 +236,7 @@  typedef struct x86_def_t {
     uint32_t xlevel;
     char model_id[48];
     int vendor_override;
-    uint32_t flags;
+    bool is_builtin;
     /* Store the results of Centaur's CPUID instructions */
     uint32_t ext4_features;
     uint32_t xlevel2;
@@ -1309,7 +1309,7 @@  void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf, const char *optarg)
         return;
     }
     for (def = x86_defs; def; def = def->next) {
-        snprintf(buf, sizeof(buf), def->flags ? "[%s]" : "%s", def->name);
+        snprintf(buf, sizeof(buf), def->is_builtin ? "[%s]" : "%s", def->name);
         if (model || dump) {
             (*cpu_fprintf)(f, "x86 %16s  %-48s\n", buf, def->model_id);
         } else {
@@ -1528,7 +1528,7 @@  void x86_cpudef_setup(void)
     for (i = 0; i < ARRAY_SIZE(builtin_x86_defs); ++i) {
         x86_def_t *def = &builtin_x86_defs[i];
         def->next = x86_defs;
-        def->flags = 1;
+        def->is_builtin = true;
 
         /* Look for specific "cpudef" models that */
         /* have the QEMU version in .model_id */