Patchwork [37/49] x86: send mce_banks as an array

login
register
mail settings
Submitter Juan Quintela
Date Sept. 29, 2009, 8:48 p.m.
Message ID <e4fa1901e113f0cc73c3bdc5b6ae588e6ccf37e8.1254255997.git.quintela@redhat.com>
Download mbox | patch
Permalink /patch/34489/
State Superseded
Headers show

Comments

Juan Quintela - Sept. 29, 2009, 8:48 p.m.
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 target-i386/machine.c |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)

Patch

diff --git a/target-i386/machine.c b/target-i386/machine.c
index 88c085d..77c7bcc 100644
--- a/target-i386/machine.c
+++ b/target-i386/machine.c
@@ -157,11 +157,8 @@  void cpu_save(QEMUFile *f, void *opaque)
     if (env->mcg_cap) {
         qemu_put_be64s(f, &env->mcg_status);
         qemu_put_be64s(f, &env->mcg_ctl);
-        for (i = 0; i < MCE_BANKS_DEF; i++) {
-            qemu_put_be64s(f, &env->mce_banks[4*i]);
-            qemu_put_be64s(f, &env->mce_banks[4*i + 1]);
-            qemu_put_be64s(f, &env->mce_banks[4*i + 2]);
-            qemu_put_be64s(f, &env->mce_banks[4*i + 3]);
+        for (i = 0; i < MCE_BANKS_DEF * 4; i++) {
+            qemu_put_be64s(f, &env->mce_banks[i]);
         }
     }
  }
@@ -354,11 +351,8 @@  int cpu_load(QEMUFile *f, void *opaque, int version_id)
         if (env->mcg_cap) {
             qemu_get_be64s(f, &env->mcg_status);
             qemu_get_be64s(f, &env->mcg_ctl);
-            for (i = 0; i < MCE_BANKS_DEF; i++) {
-                qemu_get_be64s(f, &env->mce_banks[4*i]);
-                qemu_get_be64s(f, &env->mce_banks[4*i + 1]);
-                qemu_get_be64s(f, &env->mce_banks[4*i + 2]);
-                qemu_get_be64s(f, &env->mce_banks[4*i + 3]);
+            for (i = 0; i < MCE_BANKS_DEF * 4; i++) {
+                qemu_get_be64s(f, &env->mce_banks[i]);
             }
         }
     }