ソースを参照

vmstate: Constify some VMStateDescriptions

Constify vmstate_ecc_state and vmstate_x86_cpu.

Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210408140706.23412-1-zhukeqian1@huawei.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Keqian Zhu 4 年 前
コミット
ac701a4f98
4 ファイル変更4 行追加4 行削除
  1. 1 1
      hw/block/ecc.c
  2. 1 1
      include/hw/block/flash.h
  3. 1 1
      target/i386/cpu.h
  4. 1 1
      target/i386/machine.c

+ 1 - 1
hw/block/ecc.c

@@ -78,7 +78,7 @@ void ecc_reset(ECCState *s)
 }
 }
 
 
 /* Save/restore */
 /* Save/restore */
-VMStateDescription vmstate_ecc_state = {
+const VMStateDescription vmstate_ecc_state = {
     .name = "ecc-state",
     .name = "ecc-state",
     .version_id = 0,
     .version_id = 0,
     .minimum_version_id = 0,
     .minimum_version_id = 0,

+ 1 - 1
include/hw/block/flash.h

@@ -74,6 +74,6 @@ typedef struct {
 
 
 uint8_t ecc_digest(ECCState *s, uint8_t sample);
 uint8_t ecc_digest(ECCState *s, uint8_t sample);
 void ecc_reset(ECCState *s);
 void ecc_reset(ECCState *s);
-extern VMStateDescription vmstate_ecc_state;
+extern const VMStateDescription vmstate_ecc_state;
 
 
 #endif
 #endif

+ 1 - 1
target/i386/cpu.h

@@ -1786,7 +1786,7 @@ struct X86CPU {
 
 
 
 
 #ifndef CONFIG_USER_ONLY
 #ifndef CONFIG_USER_ONLY
-extern VMStateDescription vmstate_x86_cpu;
+extern const VMStateDescription vmstate_x86_cpu;
 #endif
 #endif
 
 
 int x86_cpu_pending_interrupt(CPUState *cs, int interrupt_request);
 int x86_cpu_pending_interrupt(CPUState *cs, int interrupt_request);

+ 1 - 1
target/i386/machine.c

@@ -1396,7 +1396,7 @@ static const VMStateDescription vmstate_msr_tsx_ctrl = {
     }
     }
 };
 };
 
 
-VMStateDescription vmstate_x86_cpu = {
+const VMStateDescription vmstate_x86_cpu = {
     .name = "cpu",
     .name = "cpu",
     .version_id = 12,
     .version_id = 12,
     .minimum_version_id = 11,
     .minimum_version_id = 11,