diff mbox series

[v3,2/4] hw/char: Use v2 VMStateDescription for STM32L4x5 USART

Message ID 20240523194441.21036-3-ines.varhol@telecom-paris.fr (mailing list archive)
State New
Headers show
Series Check clock connection between STM32L4x5 RCC and peripherals | expand

Commit Message

Inès Varhol May 23, 2024, 7:41 p.m. UTC
`vmstate_stm32l4x5_usart_base` namely uses `VMSTATE_CLOCK` so
version needs to be 2.

Signed-off-by: Inès Varhol <ines.varhol@telecom-paris.fr>
---
 hw/char/stm32l4x5_usart.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Peter Maydell May 28, 2024, 2:39 p.m. UTC | #1
On Thu, 23 May 2024 at 20:44, Inès Varhol <ines.varhol@telecom-paris.fr> wrote:
>
> `vmstate_stm32l4x5_usart_base` namely uses `VMSTATE_CLOCK` so
> version needs to be 2.
>
> Signed-off-by: Inès Varhol <ines.varhol@telecom-paris.fr>
> ---
>  hw/char/stm32l4x5_usart.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/char/stm32l4x5_usart.c b/hw/char/stm32l4x5_usart.c
> index 02f666308c..0f16f0917a 100644
> --- a/hw/char/stm32l4x5_usart.c
> +++ b/hw/char/stm32l4x5_usart.c
> @@ -546,8 +546,8 @@ static int stm32l4x5_usart_base_post_load(void *opaque, int version_id)
>
>  static const VMStateDescription vmstate_stm32l4x5_usart_base = {
>      .name = TYPE_STM32L4X5_USART_BASE,
> -    .version_id = 1,
> -    .minimum_version_id = 1,
> +    .version_id = 2,
> +    .minimum_version_id = 2,

I don't understand why we are bumping the version number here;
can you explain? Usually we bump the version number when we
add a new vmstate field to the vmstate, but this commit doesn't
do that.

thanks
-- PMM
diff mbox series

Patch

diff --git a/hw/char/stm32l4x5_usart.c b/hw/char/stm32l4x5_usart.c
index 02f666308c..0f16f0917a 100644
--- a/hw/char/stm32l4x5_usart.c
+++ b/hw/char/stm32l4x5_usart.c
@@ -546,8 +546,8 @@  static int stm32l4x5_usart_base_post_load(void *opaque, int version_id)
 
 static const VMStateDescription vmstate_stm32l4x5_usart_base = {
     .name = TYPE_STM32L4X5_USART_BASE,
-    .version_id = 1,
-    .minimum_version_id = 1,
+    .version_id = 2,
+    .minimum_version_id = 2,
     .post_load = stm32l4x5_usart_base_post_load,
     .fields = (VMStateField[]) {
         VMSTATE_UINT32(cr1, Stm32l4x5UsartBaseState),