Skip to content

Commit

Permalink
hw/acpi: Constify VMState
Browse files Browse the repository at this point in the history
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20231221031652.119827-22-richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed Dec 29, 2023
1 parent d19630d commit c559ba5
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions hw/acpi/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ static const VMStateDescription vmstate_cpuhp_sts = {
.name = "CPU hotplug device state",
.version_id = 1,
.minimum_version_id = 1,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_BOOL(is_inserting, AcpiCpuStatus),
VMSTATE_BOOL(is_removing, AcpiCpuStatus),
VMSTATE_UINT32(ost_event, AcpiCpuStatus),
Expand All @@ -310,7 +310,7 @@ const VMStateDescription vmstate_cpu_hotplug = {
.name = "CPU hotplug state",
.version_id = 1,
.minimum_version_id = 1,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_UINT32(selector, CPUHotplugState),
VMSTATE_UINT8(command, CPUHotplugState),
VMSTATE_STRUCT_VARRAY_POINTER_UINT32(devs, CPUHotplugState, dev_count,
Expand Down
2 changes: 1 addition & 1 deletion hw/acpi/erst.c
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ static const VMStateDescription erst_vmstate = {
.version_id = 1,
.minimum_version_id = 1,
.post_load = erst_post_load,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_UINT8(operation, ERSTDeviceState),
VMSTATE_UINT8(busy_status, ERSTDeviceState),
VMSTATE_UINT8(command_status, ERSTDeviceState),
Expand Down
12 changes: 6 additions & 6 deletions hw/acpi/generic_event_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ static const VMStateDescription vmstate_memhp_state = {
.name = "acpi-ged/memhp",
.version_id = 1,
.minimum_version_id = 1,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_MEMORY_HOTPLUG(memhp_state, AcpiGedState),
VMSTATE_END_OF_LIST()
}
Expand All @@ -322,7 +322,7 @@ static const VMStateDescription vmstate_ged_state = {
.name = "acpi-ged-state",
.version_id = 1,
.minimum_version_id = 1,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_UINT32(sel, GEDState),
VMSTATE_END_OF_LIST()
}
Expand All @@ -332,7 +332,7 @@ static const VMStateDescription vmstate_ghes = {
.name = "acpi-ghes",
.version_id = 1,
.minimum_version_id = 1,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_UINT64(ghes_addr_le, AcpiGhesState),
VMSTATE_END_OF_LIST()
},
Expand All @@ -349,7 +349,7 @@ static const VMStateDescription vmstate_ghes_state = {
.version_id = 1,
.minimum_version_id = 1,
.needed = ghes_needed,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_STRUCT(ghes_state, AcpiGedState, 1,
vmstate_ghes, AcpiGhesState),
VMSTATE_END_OF_LIST()
Expand All @@ -360,11 +360,11 @@ static const VMStateDescription vmstate_acpi_ged = {
.name = "acpi-ged",
.version_id = 1,
.minimum_version_id = 1,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_STRUCT(ged_state, AcpiGedState, 1, vmstate_ged_state, GEDState),
VMSTATE_END_OF_LIST(),
},
.subsections = (const VMStateDescription * []) {
.subsections = (const VMStateDescription * const []) {
&vmstate_memhp_state,
&vmstate_ghes_state,
NULL
Expand Down
12 changes: 6 additions & 6 deletions hw/acpi/ich9.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ static const VMStateDescription vmstate_memhp_state = {
.version_id = 1,
.minimum_version_id = 1,
.needed = vmstate_test_use_memhp,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_MEMORY_HOTPLUG(acpi_memory_hotplug, ICH9LPCPMRegs),
VMSTATE_END_OF_LIST()
}
Expand All @@ -181,7 +181,7 @@ static const VMStateDescription vmstate_tco_io_state = {
.version_id = 1,
.minimum_version_id = 1,
.needed = vmstate_test_use_tco,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_STRUCT(tco_regs, ICH9LPCPMRegs, 1, vmstate_tco_io_sts,
TCOIORegs),
VMSTATE_END_OF_LIST()
Expand All @@ -208,7 +208,7 @@ static const VMStateDescription vmstate_cpuhp_state = {
.minimum_version_id = 1,
.needed = vmstate_test_use_cpuhp,
.pre_load = vmstate_cpuhp_pre_load,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_CPU_HOTPLUG(cpuhp_state, ICH9LPCPMRegs),
VMSTATE_END_OF_LIST()
}
Expand All @@ -226,7 +226,7 @@ static const VMStateDescription vmstate_pcihp_state = {
.version_id = 1,
.minimum_version_id = 1,
.needed = vmstate_test_use_pcihp,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_PCI_HOTPLUG(acpi_pci_hotplug,
ICH9LPCPMRegs,
NULL, NULL),
Expand All @@ -239,7 +239,7 @@ const VMStateDescription vmstate_ich9_pm = {
.version_id = 1,
.minimum_version_id = 1,
.post_load = ich9_pm_post_load,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_UINT16(acpi_regs.pm1.evt.sts, ICH9LPCPMRegs),
VMSTATE_UINT16(acpi_regs.pm1.evt.en, ICH9LPCPMRegs),
VMSTATE_UINT16(acpi_regs.pm1.cnt.cnt, ICH9LPCPMRegs),
Expand All @@ -251,7 +251,7 @@ const VMStateDescription vmstate_ich9_pm = {
VMSTATE_UINT32(smi_sts, ICH9LPCPMRegs),
VMSTATE_END_OF_LIST()
},
.subsections = (const VMStateDescription*[]) {
.subsections = (const VMStateDescription * const []) {
&vmstate_memhp_state,
&vmstate_tco_io_state,
&vmstate_cpuhp_state,
Expand Down
2 changes: 1 addition & 1 deletion hw/acpi/ich9_tco.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ const VMStateDescription vmstate_tco_io_sts = {
.name = "tco io device status",
.version_id = 1,
.minimum_version_id = 1,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_UINT16(tco.rld, TCOIORegs),
VMSTATE_UINT8(tco.din, TCOIORegs),
VMSTATE_UINT8(tco.dout, TCOIORegs),
Expand Down
4 changes: 2 additions & 2 deletions hw/acpi/memory_hotplug.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ static const VMStateDescription vmstate_memhp_sts = {
.name = "memory hotplug device state",
.version_id = 1,
.minimum_version_id = 1,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_BOOL(is_enabled, MemStatus),
VMSTATE_BOOL(is_inserting, MemStatus),
VMSTATE_UINT32(ost_event, MemStatus),
Expand All @@ -330,7 +330,7 @@ const VMStateDescription vmstate_memory_hotplug = {
.name = "memory hotplug state",
.version_id = 1,
.minimum_version_id = 1,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_UINT32(selector, MemHotplugState),
VMSTATE_STRUCT_VARRAY_POINTER_UINT32(devs, MemHotplugState, dev_count,
vmstate_memhp_sts, MemStatus),
Expand Down
2 changes: 1 addition & 1 deletion hw/acpi/pcihp.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ const VMStateDescription vmstate_acpi_pcihp_pci_status = {
.name = "acpi_pcihp_pci_status",
.version_id = 1,
.minimum_version_id = 1,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_UINT32(up, AcpiPciHpPciStatus),
VMSTATE_UINT32(down, AcpiPciHpPciStatus),
VMSTATE_END_OF_LIST()
Expand Down
12 changes: 6 additions & 6 deletions hw/acpi/piix4.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ static const VMStateDescription vmstate_gpe = {
.name = "gpe",
.version_id = 1,
.minimum_version_id = 1,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_GPE_ARRAY(sts, ACPIGPE),
VMSTATE_GPE_ARRAY(en, ACPIGPE),
VMSTATE_END_OF_LIST()
Expand All @@ -158,7 +158,7 @@ static const VMStateDescription vmstate_pci_status = {
.name = "pci_status",
.version_id = 1,
.minimum_version_id = 1,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_UINT32(up, struct AcpiPciHpPciStatus),
VMSTATE_UINT32(down, struct AcpiPciHpPciStatus),
VMSTATE_END_OF_LIST()
Expand Down Expand Up @@ -189,7 +189,7 @@ static const VMStateDescription vmstate_memhp_state = {
.version_id = 1,
.minimum_version_id = 1,
.needed = vmstate_test_use_memhp,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_MEMORY_HOTPLUG(acpi_memory_hotplug, PIIX4PMState),
VMSTATE_END_OF_LIST()
}
Expand All @@ -214,7 +214,7 @@ static const VMStateDescription vmstate_cpuhp_state = {
.minimum_version_id = 1,
.needed = vmstate_test_use_cpuhp,
.pre_load = vmstate_cpuhp_pre_load,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_CPU_HOTPLUG(cpuhp_state, PIIX4PMState),
VMSTATE_END_OF_LIST()
}
Expand Down Expand Up @@ -247,7 +247,7 @@ static const VMStateDescription vmstate_acpi = {
.version_id = 3,
.minimum_version_id = 3,
.post_load = vmstate_acpi_post_load,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_PCI_DEVICE(parent_obj, PIIX4PMState),
VMSTATE_UINT16(ar.pm1.evt.sts, PIIX4PMState),
VMSTATE_UINT16(ar.pm1.evt.en, PIIX4PMState),
Expand All @@ -269,7 +269,7 @@ static const VMStateDescription vmstate_acpi = {
vmstate_test_migrate_acpi_index),
VMSTATE_END_OF_LIST()
},
.subsections = (const VMStateDescription*[]) {
.subsections = (const VMStateDescription * const []) {
&vmstate_memhp_state,
&vmstate_cpuhp_state,
NULL
Expand Down
2 changes: 1 addition & 1 deletion hw/acpi/vmgenid.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ static const VMStateDescription vmstate_vmgenid = {
.version_id = 1,
.minimum_version_id = 1,
.post_load = vmgenid_post_load,
.fields = (VMStateField[]) {
.fields = (const VMStateField[]) {
VMSTATE_UINT8_ARRAY(vmgenid_addr_le, VmGenIdState, sizeof(uint64_t)),
VMSTATE_END_OF_LIST()
},
Expand Down

0 comments on commit c559ba5

Please sign in to comment.