vmstate: Constify some VMStateDescriptions
PATCH 1/1 vmstate: Constify some VMStateDescriptions
Constify vmstate_ecc_state and vmstate_x86_cpu.
Signed-off-by Keqian Zhu <[email protected]>
--- hw/block/ecc.c | 2 +- include/hw/block/flash.h | 2 +- target/i386/cpu.h | 2 +- target/i386/machine.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
hw/block/ecc.c +1 -1
@@ -78,7 +78,7 @@ void ecc_reset(ECCState *s) }/* Save/restore */ -VMStateDescription vmstate_ecc_state = { +const VMStateDescription vmstate_ecc_state = { .name ="ecc-state" , .version_id =0 , .minimum_version_id =0 ,
include/hw/block/flash.h +1 -1
@@ -74,6 +74,6 @@ typedef struct {uint8_t ecc_digest (ECCState *s,uint8_t sample);void ecc_reset (ECCState *s); -extern VMStateDescription vmstate_ecc_state; +extern const VMStateDescription vmstate_ecc_state;#endif
target/i386/cpu.h +1 -1
@@ -1786,7 +1786,7 @@ struct X86CPU {#ifndef CONFIG_USER_ONLY -extern VMStateDescription vmstate_x86_cpu; +extern const VMStateDescription vmstate_x86_cpu;#endif int x86_cpu_pending_interrupt (CPUState *cs,int interrupt_request);
target/i386/machine.c +1 -1
@@ -1396,7 +1396,7 @@ static const VMStateDescription vmstate_msr_tsx_ctrl = { } }; -VMStateDescription vmstate_x86_cpu = { +const VMStateDescription vmstate_x86_cpu = { .name ="cpu" , .version_id =12 , .minimum_version_id =11 ,
Signature · 1 line
2.19.1
Quoted 9 lines · Keqian Zhu
Constify
vmstate_ecc_stateandvmstate_x86_cpu.Signed-off-by Keqian Zhu <[email protected]>--- hw/block/ecc.c | 2 +- include/hw/block/flash.h | 2 +- target/i386/cpu.h | 2 +- target/i386/machine.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
Reviewed-by Philippe Mathieu-Daudé <[email protected]>
Quoted 9 lines · Keqian Zhu
Constify
vmstate_ecc_stateandvmstate_x86_cpu.Signed-off-by Keqian Zhu<[email protected]>--- hw/block/ecc.c | 2 +- include/hw/block/flash.h | 2 +- target/i386/cpu.h | 2 +- target/i386/machine.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
Reviewed-by Richard Henderson <[email protected]>
r~
Laurent Vivier
AppliedLe 08/04/2021 à 16:07, Keqian Zhu a écrit :
Quoted 54 lines
Constify
vmstate_ecc_stateandvmstate_x86_cpu.Signed-off-by Keqian Zhu <[email protected]>--- hw/block/ecc.c | 2 +- include/hw/block/flash.h | 2 +- target/i386/cpu.h | 2 +- target/i386/machine.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)hw/block/ecc.c +1
-1@@ -78,7 +78,7 @@ void ecc_reset(ECCState *s) }/* Save/restore */ -VMStateDescription vmstate_ecc_state = { +const VMStateDescription vmstate_ecc_state = { .name ="ecc-state" , .version_id =0 , .minimum_version_id =0 ,include/hw/block/flash.h +1
-1@@ -74,6 +74,6 @@ typedef struct {uint8_t ecc_digest (ECCState *s,uint8_t sample);void ecc_reset (ECCState *s); -extern VMStateDescription vmstate_ecc_state; +extern const VMStateDescription vmstate_ecc_state;#endif target/i386/cpu.h +1
-1@@ -1786,7 +1786,7 @@ struct X86CPU {#ifndef CONFIG_USER_ONLY -extern VMStateDescription vmstate_x86_cpu; +extern const VMStateDescription vmstate_x86_cpu;#endif int x86_cpu_pending_interrupt (CPUState *cs,int interrupt_request);target/i386/machine.c +0
-0
target/i386/machine.c static const VMStateDescription vmstate_msr_tsx_ctrl = { · line 1402
Quoted 8 lines
target/i386/machine.c +1
-1@@ -1396,7 +1396,7 @@ static const VMStateDescription vmstate_msr_tsx_ctrl = { } }; -VMStateDescription vmstate_x86_cpu = { +const VMStateDescription vmstate_x86_cpu = { .name ="cpu" , .version_id =12 , .minimum_version_id =11 ,
Applied to my trivial-patches branch.
Thanks,
Laurent