hw: Constify VMStateDescription
cover hw: Constify VMStateDescription
VMStateDescription isn't supposed to be modified.
Philippe Mathieu-Daudé (3):
hw/arm: Constify VMStateDescription
hw/display/qxl: Constify VMStateDescription
hw/usb: Constify VMStateDescription
hw/arm/highbank.c | 2 +- hw/arm/pxa2xx_pic.c | 2 +- hw/arm/spitz.c | 4 ++-- hw/arm/strongarm.c | 2 +- hw/arm/z2.c | 4 ++-- hw/display/qxl.c | 8 ++++---- hw/dma/pxa2xx_dma.c | 4 ++-- hw/misc/mst_fpga.c | 2 +- hw/usb/ccid-card-passthru.c | 2 +- hw/usb/dev-smartcard-reader.c | 8 ++++---- 10 files changed, 19 insertions(+), 19 deletions(-)
Signature · 1 line
2.26.2
PATCH 1/3 hw/arm: Constify VMStateDescription
--- hw/arm/highbank.c | 2 +- hw/arm/pxa2xx_pic.c | 2 +- hw/arm/spitz.c | 4 ++-- hw/arm/strongarm.c | 2 +- hw/arm/z2.c | 4 ++-- hw/dma/pxa2xx_dma.c | 4 ++-- hw/misc/mst_fpga.c | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-)
hw/arm/highbank.c +1 -1
@@ -170,7 +170,7 @@ struct HighbankRegsState {uint32_t regs[NUM_REGS ]; }; -static VMStateDescription vmstate_highbank_regs = { +static const VMStateDescription vmstate_highbank_regs = { .name ="highbank-regs" , .version_id =0 , .minimum_version_id =0 ,
hw/arm/pxa2xx_pic.c +1 -1
@@ -301,7 +301,7 @@ DeviceState *pxa2xx_pic_init(hwaddr base, ARMCPU *cpu)return dev; } -static VMStateDescription vmstate_pxa2xx_pic_regs = { +static const VMStateDescription vmstate_pxa2xx_pic_regs = { .name ="pxa2xx_pic" , .version_id =0 , .minimum_version_id =0 ,
hw/arm/spitz.c +2 -2
@@ -1134,7 +1134,7 @@ static bool is_version_0(void *opaque, int version_id)return version_id ==0 ; } -static VMStateDescription vmstate_sl_nand_info = { +static const VMStateDescription vmstate_sl_nand_info = { .name ="sl-nand" , .version_id =0 , .minimum_version_id =0 ,
@@ -1170,7 +1170,7 @@ static const TypeInfo sl_nand_info = { .class_init = sl_nand_class_init, }; -static VMStateDescription vmstate_spitz_kbd = { +static const VMStateDescription vmstate_spitz_kbd = { .name ="spitz-keyboard" , .version_id =1 , .minimum_version_id =0 ,
hw/arm/strongarm.c +1 -1
@@ -207,7 +207,7 @@ static int strongarm_pic_post_load(void *opaque, int version_id)return 0 ; } -static VMStateDescription vmstate_strongarm_pic_regs = { +static const VMStateDescription vmstate_strongarm_pic_regs = { .name ="strongarm_pic" , .version_id =0 , .minimum_version_id =0 ,
hw/arm/z2.c +2 -2
@@ -162,7 +162,7 @@ static void zipit_lcd_realize(SSIPeripheral *dev, Error **errp) z->pos =0 ; } -static VMStateDescription vmstate_zipit_lcd_state = { +static const VMStateDescription vmstate_zipit_lcd_state = { .name ="zipit-lcd" , .version_id =2 , .minimum_version_id =2 ,
@@ -268,7 +268,7 @@ static uint8_t aer915_recv(I2CSlave *slave)return retval; } -static VMStateDescription vmstate_aer915_state = { +static const VMStateDescription vmstate_aer915_state = { .name ="aer915" , .version_id =1 , .minimum_version_id =1 ,
hw/dma/pxa2xx_dma.c +2 -2
@@ -525,7 +525,7 @@ static bool is_version_0(void *opaque, int version_id)return version_id ==0 ; } -static VMStateDescription vmstate_pxa2xx_dma_chan = { +static const VMStateDescription vmstate_pxa2xx_dma_chan = { .name ="pxa2xx_dma_chan" , .version_id =1 , .minimum_version_id =1 ,
@@ -540,7 +540,7 @@ static VMStateDescription vmstate_pxa2xx_dma_chan = { }, }; -static VMStateDescription vmstate_pxa2xx_dma = { +static const VMStateDescription vmstate_pxa2xx_dma = { .name ="pxa2xx_dma" , .version_id =1 , .minimum_version_id =0 ,
hw/misc/mst_fpga.c +1 -1
@@ -222,7 +222,7 @@ static void mst_fpga_init(Object *obj)sysbus_init_mmio (sbd, &s->iomem); } -static VMStateDescription vmstate_mst_fpga_regs = { +static const VMStateDescription vmstate_mst_fpga_regs = { .name ="mainstone_fpga" , .version_id =0 , .minimum_version_id =0 ,
Signature · 1 line
2.26.2
Laurent Vivier
AppliedRe: [PATCH 1/3] hw/arm: Constify VMStateDescription
Le 13/03/2021 à 18:11, Philippe Mathieu-Daudé a écrit :
Quoted 122 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/arm/highbank.c | 2 +- hw/arm/pxa2xx_pic.c | 2 +- hw/arm/spitz.c | 4 ++-- hw/arm/strongarm.c | 2 +- hw/arm/z2.c | 4 ++-- hw/dma/pxa2xx_dma.c | 4 ++-- hw/misc/mst_fpga.c | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-)hw/arm/highbank.c +1
-1@@ -170,7 +170,7 @@ struct HighbankRegsState {uint32_t regs[NUM_REGS ]; }; -static VMStateDescription vmstate_highbank_regs = { +static const VMStateDescription vmstate_highbank_regs = { .name ="highbank-regs" , .version_id =0 , .minimum_version_id =0 ,hw/arm/pxa2xx_pic.c +1
-1@@ -301,7 +301,7 @@ DeviceState *pxa2xx_pic_init(hwaddr base, ARMCPU *cpu)return dev; } -static VMStateDescription vmstate_pxa2xx_pic_regs = { +static const VMStateDescription vmstate_pxa2xx_pic_regs = { .name ="pxa2xx_pic" , .version_id =0 , .minimum_version_id =0 ,hw/arm/spitz.c +2
-2@@ -1134,7 +1134,7 @@ static bool is_version_0(void *opaque, int version_id)return version_id ==0 ; } -static VMStateDescription vmstate_sl_nand_info = { +static const VMStateDescription vmstate_sl_nand_info = { .name ="sl-nand" , .version_id =0 , .minimum_version_id =0 ,@@ -1170,7 +1170,7 @@ static const TypeInfo sl_nand_info = { .class_init = sl_nand_class_init, }; -static VMStateDescription vmstate_spitz_kbd = { +static const VMStateDescription vmstate_spitz_kbd = { .name ="spitz-keyboard" , .version_id =1 , .minimum_version_id =0 ,hw/arm/strongarm.c +1
-1@@ -207,7 +207,7 @@ static int strongarm_pic_post_load(void *opaque, int version_id)return 0 ; } -static VMStateDescription vmstate_strongarm_pic_regs = { +static const VMStateDescription vmstate_strongarm_pic_regs = { .name ="strongarm_pic" , .version_id =0 , .minimum_version_id =0 ,hw/arm/z2.c +2
-2@@ -162,7 +162,7 @@ static void zipit_lcd_realize(SSIPeripheral *dev, Error **errp) z->pos =0 ; } -static VMStateDescription vmstate_zipit_lcd_state = { +static const VMStateDescription vmstate_zipit_lcd_state = { .name ="zipit-lcd" , .version_id =2 , .minimum_version_id =2 ,@@ -268,7 +268,7 @@ static uint8_t aer915_recv(I2CSlave *slave)return retval; } -static VMStateDescription vmstate_aer915_state = { +static const VMStateDescription vmstate_aer915_state = { .name ="aer915" , .version_id =1 , .minimum_version_id =1 ,hw/dma/pxa2xx_dma.c +2
-2@@ -525,7 +525,7 @@ static bool is_version_0(void *opaque, int version_id)return version_id ==0 ; } -static VMStateDescription vmstate_pxa2xx_dma_chan = { +static const VMStateDescription vmstate_pxa2xx_dma_chan = { .name ="pxa2xx_dma_chan" , .version_id =1 , .minimum_version_id =1 ,@@ -540,7 +540,7 @@ static VMStateDescription vmstate_pxa2xx_dma_chan = { }, }; -static VMStateDescription vmstate_pxa2xx_dma = { +static const VMStateDescription vmstate_pxa2xx_dma = { .name ="pxa2xx_dma" , .version_id =1 , .minimum_version_id =0 ,hw/misc/mst_fpga.c +0
-0
hw/misc/mst_fpga.c static void mst_fpga_init(Object *obj) · line 228
Quoted 8 lines
hw/misc/mst_fpga.c +1
-1@@ -222,7 +222,7 @@ static void mst_fpga_init(Object *obj)sysbus_init_mmio (sbd, &s->iomem); } -static VMStateDescription vmstate_mst_fpga_regs = { +static const VMStateDescription vmstate_mst_fpga_regs = { .name ="mainstone_fpga" , .version_id =0 , .minimum_version_id =0 ,
Applied to my trivial-patches branch.
Thanks,
Laurent
PATCH 2/3 hw/display/qxl: Constify VMStateDescription
In reply to Philippe Mathieu-Daudé--- hw/display/qxl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
hw/display/qxl.c +4 -4
@@ -2384,7 +2384,7 @@ static bool qxl_monitors_config_needed(void *opaque) } -static VMStateDescription qxl_memslot = { +static const VMStateDescription qxl_memslot = { .name ="qxl-memslot" , .version_id =QXL_SAVE_VERSION , .minimum_version_id =QXL_SAVE_VERSION ,
@@ -2396,7 +2396,7 @@ static VMStateDescription qxl_memslot = { } }; -static VMStateDescription qxl_surface = { +static const VMStateDescription qxl_surface = { .name ="qxl-surface" , .version_id =QXL_SAVE_VERSION , .minimum_version_id =QXL_SAVE_VERSION ,
@@ -2414,7 +2414,7 @@ static VMStateDescription qxl_surface = { } }; -static VMStateDescription qxl_vmstate_monitors_config = { +static const VMStateDescription qxl_vmstate_monitors_config = { .name ="qxl/monitors-config" , .version_id =1 , .minimum_version_id =1 ,
@@ -2425,7 +2425,7 @@ static VMStateDescription qxl_vmstate_monitors_config = { }, }; -static VMStateDescription qxl_vmstate = { +static const VMStateDescription qxl_vmstate = { .name ="qxl" , .version_id =QXL_SAVE_VERSION , .minimum_version_id =QXL_SAVE_VERSION ,
Signature · 1 line
2.26.2
Laurent Vivier
AppliedRe: [PATCH 2/3] hw/display/qxl: Constify VMStateDescription
Le 13/03/2021 à 18:11, Philippe Mathieu-Daudé a écrit :
Quoted 38 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/display/qxl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)hw/display/qxl.c +3
-3@@ -2384,7 +2384,7 @@ static bool qxl_monitors_config_needed(void *opaque) } -static VMStateDescription qxl_memslot = { +static const VMStateDescription qxl_memslot = { .name ="qxl-memslot" , .version_id =QXL_SAVE_VERSION , .minimum_version_id =QXL_SAVE_VERSION ,@@ -2396,7 +2396,7 @@ static VMStateDescription qxl_memslot = { } }; -static VMStateDescription qxl_surface = { +static const VMStateDescription qxl_surface = { .name ="qxl-surface" , .version_id =QXL_SAVE_VERSION , .minimum_version_id =QXL_SAVE_VERSION ,@@ -2414,7 +2414,7 @@ static VMStateDescription qxl_surface = { } }; -static VMStateDescription qxl_vmstate_monitors_config = { +static const VMStateDescription qxl_vmstate_monitors_config = { .name ="qxl/monitors-config" , .version_id =1 , .minimum_version_id =1 ,
hw/display/qxl.c static VMStateDescription qxl_vmstate_monitors_config = { · line 2431
Quoted 8 lines
hw/display/qxl.c +1
-1@@ -2425,7 +2425,7 @@ static VMStateDescription qxl_vmstate_monitors_config = { }, }; -static VMStateDescription qxl_vmstate = { +static const VMStateDescription qxl_vmstate = { .name ="qxl" , .version_id =QXL_SAVE_VERSION , .minimum_version_id =QXL_SAVE_VERSION ,
Applied to my trivial-patches branch.
Thanks,
Laurent
PATCH 3/3 hw/usb: Constify VMStateDescription
In reply to Philippe Mathieu-Daudé--- hw/usb/ccid-card-passthru.c | 2 +- hw/usb/dev-smartcard-reader.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-)
hw/usb/ccid-card-passthru.c +1 -1
@@ -374,7 +374,7 @@ static void passthru_realize(CCIDCardState *base, Error **errp) card->atr_length =sizeof (DEFAULT_ATR ); } -static VMStateDescription passthru_vmstate = { +static const VMStateDescription passthru_vmstate = { .name ="ccid-card-passthru" , .version_id =1 , .minimum_version_id =1 ,
hw/usb/dev-smartcard-reader.c +4 -4
@@ -1365,7 +1365,7 @@ static int ccid_pre_save(void *opaque)return 0 ; } -static VMStateDescription bulk_in_vmstate = { +static const VMStateDescription bulk_in_vmstate = { .name ="CCID BulkIn state" , .version_id =1 , .minimum_version_id =1 ,
@@ -1377,7 +1377,7 @@ static VMStateDescription bulk_in_vmstate = { } }; -static VMStateDescription answer_vmstate = { +static const VMStateDescription answer_vmstate = { .name ="CCID Answer state" , .version_id =1 , .minimum_version_id =1 ,
@@ -1388,7 +1388,7 @@ static VMStateDescription answer_vmstate = { } }; -static VMStateDescription usb_device_vmstate = { +static const VMStateDescription usb_device_vmstate = { .name ="usb_device" , .version_id =1 , .minimum_version_id =1 ,
@@ -1400,7 +1400,7 @@ static VMStateDescription usb_device_vmstate = { } }; -static VMStateDescription ccid_vmstate = { +static const VMStateDescription ccid_vmstate = { .name ="usb-ccid" , .version_id =1 , .minimum_version_id =1 ,
Signature · 1 line
2.26.2
Laurent Vivier
AppliedRe: [PATCH 3/3] hw/usb: Constify VMStateDescription
Le 13/03/2021 à 18:11, Philippe Mathieu-Daudé a écrit :
Quoted 52 lines
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- hw/usb/ccid-card-passthru.c | 2 +- hw/usb/dev-smartcard-reader.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-)hw/usb/ccid-card-passthru.c +1
-1@@ -374,7 +374,7 @@ static void passthru_realize(CCIDCardState *base, Error **errp) card->atr_length =sizeof (DEFAULT_ATR ); } -static VMStateDescription passthru_vmstate = { +static const VMStateDescription passthru_vmstate = { .name ="ccid-card-passthru" , .version_id =1 , .minimum_version_id =1 ,hw/usb/dev-smartcard-reader.c +3
-3@@ -1365,7 +1365,7 @@ static int ccid_pre_save(void *opaque)return 0 ; } -static VMStateDescription bulk_in_vmstate = { +static const VMStateDescription bulk_in_vmstate = { .name ="CCID BulkIn state" , .version_id =1 , .minimum_version_id =1 ,@@ -1377,7 +1377,7 @@ static VMStateDescription bulk_in_vmstate = { } }; -static VMStateDescription answer_vmstate = { +static const VMStateDescription answer_vmstate = { .name ="CCID Answer state" , .version_id =1 , .minimum_version_id =1 ,@@ -1388,7 +1388,7 @@ static VMStateDescription answer_vmstate = { } }; -static VMStateDescription usb_device_vmstate = { +static const VMStateDescription usb_device_vmstate = { .name ="usb_device" , .version_id =1 , .minimum_version_id =1 ,
hw/usb/dev-smartcard-reader.c static VMStateDescription usb_device_vmstate = { · line 1406
Quoted 8 lines
hw/usb/dev-smartcard-reader.c +1
-1@@ -1400,7 +1400,7 @@ static VMStateDescription usb_device_vmstate = { } }; -static VMStateDescription ccid_vmstate = { +static const VMStateDescription ccid_vmstate = { .name ="usb-ccid" , .version_id =1 , .minimum_version_id =1 ,
Applied to my trivial-patches branch.
Thanks,
Laurent
Quoted 4 lines · Philippe Mathieu-Daudé
Philippe Mathieu-Daudé (3):
hw/arm: Constify VMStateDescription
hw/display/qxl: Constify VMStateDescription
hw/usb: Constify VMStateDescription
r~
Hi Philippe,
It seems that vmstate_ecc_state and vmstate_x86_cpu can also be constified. Found by <git grep "VMStateDescription" | grep -v "const">.
Thanks,
Keqian
Quoted 38 lines · Philippe Mathieu-Daudé
VMStateDescription isn't supposed to be modified.
Philippe Mathieu-Daudé (3):
hw/arm: Constify VMStateDescription
hw/display/qxl: Constify VMStateDescription
hw/usb: Constify VMStateDescription
hw/arm/highbank.c | 2 +-hw/arm/pxa2xx_pic.c | 2 +-hw/arm/spitz.c | 4 ++--hw/arm/strongarm.c | 2 +-hw/arm/z2.c | 4 ++--hw/display/qxl.c | 8 ++++----hw/dma/pxa2xx_dma.c | 4 ++--hw/misc/mst_fpga.c | 2 +-hw/usb/ccid-card-passthru.c | 2 +-hw/usb/dev-smartcard-reader.c | 8 ++++----10 files changed, 19 insertions(+), 19 deletions(-)
Quoted 4 lines · Keqian Zhu
Hi Philippe,
It seems that
vmstate_ecc_stateandvmstate_x86_cpucan also be constified. Found by <git grep "VMStateDescription" | grep -v "const">.
Correct (I only searched for the static ones).
Do you mind sending a patch?
Quoted 6 lines
Thanks,
KeqianQuoted 1 line · Philippe Mathieu-Daudé
VMStateDescription isn't supposed to be modified.
Quoted 9 lines · Philippe Mathieu-Daudé
Quoted 4 lines · Keqian Zhu
Hi Philippe,
It seems that
vmstate_ecc_stateandvmstate_x86_cpucan also be constified. Found by <git grep "VMStateDescription" | grep -v "const">.Correct (I only searched for the static ones).
Do you mind sending a patch?
OK, I'll do. :)
BRs,
Keqian
Quoted 9 lines
Quoted 7 lines
Thanks,
KeqianQuoted 1 line · Philippe Mathieu-Daudé
VMStateDescription isn't supposed to be modified.
.