diff mbox

[qom-next,for-next,4/6] ipack: Simplify VMSTATE_IPACK_DEVICE() macro

Message ID 1375478221-22722-5-git-send-email-afaerber@suse.de
State New
Headers show

Commit Message

Andreas Färber Aug. 2, 2013, 9:16 p.m. UTC
Hardcode name and offset to avoid having to pass parent_obj to it.

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 hw/char/ipack.h      | 10 ++++++++--
 hw/char/ipoctal232.c |  2 +-
 2 files changed, 9 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/hw/char/ipack.h b/hw/char/ipack.h
index 080767f..c183383 100644
--- a/hw/char/ipack.h
+++ b/hw/char/ipack.h
@@ -72,8 +72,14 @@  struct IPackDevice {
 
 extern const VMStateDescription vmstate_ipack_device;
 
-#define VMSTATE_IPACK_DEVICE(_field, _state)                            \
-    VMSTATE_STRUCT(_field, _state, 1, vmstate_ipack_device, IPackDevice)
+#define VMSTATE_IPACK_DEVICE() {                                            \
+    .name = "parent_obj",                                                   \
+    .size = sizeof(IPackDevice),                                            \
+    .version_id = 1,                                                        \
+    .vmsd = &vmstate_ipack_device,                                          \
+    .flags = VMS_STRUCT,                                                    \
+    .offset = 0,                                                            \
+}
 
 IPackDevice *ipack_device_find(IPackBus *bus, int32_t slot);
 void ipack_bus_new_inplace(IPackBus *bus, DeviceState *parent,
diff --git a/hw/char/ipoctal232.c b/hw/char/ipoctal232.c
index 80ebe7b..08093da 100644
--- a/hw/char/ipoctal232.c
+++ b/hw/char/ipoctal232.c
@@ -156,7 +156,7 @@  static const VMStateDescription vmstate_ipoctal = {
     .minimum_version_id = 1,
     .minimum_version_id_old = 1,
     .fields      = (VMStateField[]) {
-        VMSTATE_IPACK_DEVICE(dev, IPOctalState),
+        VMSTATE_IPACK_DEVICE(),
         VMSTATE_STRUCT_ARRAY(ch, IPOctalState, N_CHANNELS, 1,
                              vmstate_scc2698_channel, SCC2698Channel),
         VMSTATE_STRUCT_ARRAY(blk, IPOctalState, N_BLOCKS, 1,