diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2014-01-01 21:56:57 +0000 |
---|---|---|
committer | Juan Quintela <quintela@redhat.com> | 2014-02-04 15:51:45 +0100 |
commit | 20bcf73fa80c3477b6aaf5f39f18f031ff55de92 (patch) | |
tree | 9206d86ca4125b3370c1b4144b9c34eccd8aebf6 /include/hw | |
parent | 8cfc114a2f293c40077d1bdb7500b29db359ca22 (diff) |
vmstate: Make VMSTATE_STRUCT_POINTER take type, not ptr-to-type
The VMSTATE_STRUCT_POINTER macros are a bit odd in that they
must be passed an argument "FooType *" rather than just taking
the FooType. They're only used in one place, so it's easy to
tidy this up. This also lets us use the macro to replace the
hand-rolled VMSTATE_PTIMER.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'include/hw')
-rw-r--r-- | include/hw/ptimer.h | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/include/hw/ptimer.h b/include/hw/ptimer.h index a33edf4b0c..8ebacbbda0 100644 --- a/include/hw/ptimer.h +++ b/include/hw/ptimer.h @@ -27,14 +27,8 @@ void ptimer_stop(ptimer_state *s); extern const VMStateDescription vmstate_ptimer; -#define VMSTATE_PTIMER(_field, _state) { \ - .name = (stringify(_field)), \ - .version_id = (1), \ - .vmsd = &vmstate_ptimer, \ - .size = sizeof(ptimer_state *), \ - .flags = VMS_STRUCT|VMS_POINTER, \ - .offset = vmstate_offset_pointer(_state, _field, ptimer_state), \ -} +#define VMSTATE_PTIMER(_field, _state) \ + VMSTATE_STRUCT_POINTER_V(_field, _state, 1, vmstate_ptimer, ptimer_state) #define VMSTATE_PTIMER_ARRAY(_f, _s, _n) \ VMSTATE_ARRAY_OF_POINTER_TO_STRUCT(_f, _s, _n, 0, \ |