Message ID | 20210710174954.2577195-6-f4bug@amsat.org |
---|---|
State | New |
Headers | show |
Series | dp8393x: fixes and improvements | expand |
On 10/07/2021 18:49, Philippe Mathieu-Daudé wrote: > The CAM registers are now arrays of 3 uint16_t. We can avoid using > the VMSTATE_BUFFER_UNSAFE() macro by using VMSTATE_UINT16_2DARRAY() > which is more appropriate. > > Suggested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> > Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> > --- > hw/net/dp8393x.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c > index 2c3047c8688..68516241a1f 100644 > --- a/hw/net/dp8393x.c > +++ b/hw/net/dp8393x.c > @@ -983,10 +983,10 @@ static void dp8393x_realize(DeviceState *dev, Error **errp) > > static const VMStateDescription vmstate_dp8393x = { > .name = "dp8393x", > - .version_id = 0, > - .minimum_version_id = 0, > + .version_id = 1, > + .minimum_version_id = 1, > .fields = (VMStateField []) { > - VMSTATE_BUFFER_UNSAFE(cam, dp8393xState, 0, 16 * 3 * 2), > + VMSTATE_UINT16_2DARRAY(cam, dp8393xState, 16, 3), > VMSTATE_UINT16_ARRAY(regs, dp8393xState, SONIC_REG_COUNT), > VMSTATE_END_OF_LIST() > } I'm not convinced that this needs an extra patch and couldn't be squashed into the previous patch, but still: Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> ATB, Mark.
diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c index 2c3047c8688..68516241a1f 100644 --- a/hw/net/dp8393x.c +++ b/hw/net/dp8393x.c @@ -983,10 +983,10 @@ static void dp8393x_realize(DeviceState *dev, Error **errp) static const VMStateDescription vmstate_dp8393x = { .name = "dp8393x", - .version_id = 0, - .minimum_version_id = 0, + .version_id = 1, + .minimum_version_id = 1, .fields = (VMStateField []) { - VMSTATE_BUFFER_UNSAFE(cam, dp8393xState, 0, 16 * 3 * 2), + VMSTATE_UINT16_2DARRAY(cam, dp8393xState, 16, 3), VMSTATE_UINT16_ARRAY(regs, dp8393xState, SONIC_REG_COUNT), VMSTATE_END_OF_LIST() }
The CAM registers are now arrays of 3 uint16_t. We can avoid using the VMSTATE_BUFFER_UNSAFE() macro by using VMSTATE_UINT16_2DARRAY() which is more appropriate. Suggested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> --- hw/net/dp8393x.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)