From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50254) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V5Mir-0000Ly-IZ for qemu-devel@nongnu.org; Fri, 02 Aug 2013 17:17:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V5Mil-0007hM-E8 for qemu-devel@nongnu.org; Fri, 02 Aug 2013 17:17:17 -0400 Received: from cantor2.suse.de ([195.135.220.15]:33278 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V5Mil-0007hF-7P for qemu-devel@nongnu.org; Fri, 02 Aug 2013 17:17:11 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Fri, 2 Aug 2013 23:16:59 +0200 Message-Id: <1375478221-22722-5-git-send-email-afaerber@suse.de> In-Reply-To: <1375478221-22722-1-git-send-email-afaerber@suse.de> References: <1375478221-22722-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH qom-next for-next 4/6] ipack: Simplify VMSTATE_IPACK_DEVICE() macro List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alberto Garcia , =?UTF-8?q?Andreas=20F=C3=A4rber?= Hardcode name and offset to avoid having to pass parent_obj to it. Signed-off-by: Andreas F=C3=A4rber --- hw/char/ipack.h | 10 ++++++++-- hw/char/ipoctal232.c | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) 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 { =20 extern const VMStateDescription vmstate_ipack_device; =20 -#define VMSTATE_IPACK_DEVICE(_field, _state) = \ - VMSTATE_STRUCT(_field, _state, 1, vmstate_ipack_device, IPackDevice) +#define VMSTATE_IPACK_DEVICE() { = \ + .name =3D "parent_obj", = \ + .size =3D sizeof(IPackDevice), = \ + .version_id =3D 1, = \ + .vmsd =3D &vmstate_ipack_device, = \ + .flags =3D VMS_STRUCT, = \ + .offset =3D 0, = \ +} =20 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 =3D { .minimum_version_id =3D 1, .minimum_version_id_old =3D 1, .fields =3D (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, --=20 1.8.1.4