Skip to contentSkip to conversation

qom: Use typedefs instead of struct names on instance_size/class_size

PATCH In review Eduardo Habkost 2 participants 3 messages Aug 24, 2020 Arm/Zynq architecture

lore
Share & tools
lore
#0 lore raw

cover qom: Use typedefs instead of struct names on instance_size/class_size

This changes existing QOM boilerplate to use existing typedef names when setting instance_size and class_size on TypeInfo variables. This makes the code more consistent and will make future conversion to QOM type declaration macros easier.

Cc "Michael S. Tsirkin" <[email protected]>
Cc "Marc-André Lureau" <[email protected]>
Cc Gerd Hoffmann <[email protected]>
Cc "Edgar E. Iglesias" <[email protected]>
Cc Alistair Francis <[email protected]>
Cc Peter Maydell <[email protected]>
Cc Marcel Apfelbaum <[email protected]>
Cc Jason Wang <[email protected]>

Eduardo Habkost (6):
xilinx_axidma: Use typedef name for instance_size
omap_intc: Use typedef name for instance_size
lpc_ich9: Use typedef name for instance_size
xilinx_axienet: Use typedef name for instance_size
vhost-user-vga: Use typedef name for instance_size
virtio-vga: Use typedef name for instance_size

 hw/display/vhost-user-vga.c | 2 +-
 hw/display/virtio-vga.c     | 6 +++---
 hw/dma/xilinx_axidma.c      | 4 ++--
 hw/intc/omap_intc.c         | 2 +-
 hw/isa/lpc_ich9.c           | 2 +-
 hw/net/xilinx_axienet.c     | 4 ++--
 6 files changed, 10 insertions(+), 10 deletions(-)
Signature · 1 line
2.26.2
#1 lore raw

PATCH 1/6 xilinx_axidma: Use typedef name for instance_size

This makes the code consistent with the rest of QOM code in QEMU, and will make automated conversion to type declaration macros simpler.

---
Cc: "Edgar E. Iglesias" <[email protected]>
Cc: Alistair Francis <[email protected]>
Cc: Peter Maydell <[email protected]>
Cc: [email protected]
Cc: [email protected]

---
 hw/dma/xilinx_axidma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/dma/xilinx_axidma.c +2 -2
index a4812e480a..5ad8bd3d2e 100644
@@ -634,7 +634,7 @@ static const TypeInfo axidma_info = {
 static const TypeInfo xilinx_axidma_data_stream_info = {
     .name          = TYPE_XILINX_AXI_DMA_DATA_STREAM,
     .parent        = TYPE_OBJECT,
-    .instance_size = sizeof(struct XilinxAXIDMAStreamSlave),
+    .instance_size = sizeof(XilinxAXIDMAStreamSlave),
     .class_init    = xilinx_axidma_stream_class_init,
     .class_data    = &xilinx_axidma_data_stream_class,
     .interfaces = (InterfaceInfo[]) {
@@ -646,7 +646,7 @@ static const TypeInfo xilinx_axidma_data_stream_info = {
 static const TypeInfo xilinx_axidma_control_stream_info = {
     .name          = TYPE_XILINX_AXI_DMA_CONTROL_STREAM,
     .parent        = TYPE_OBJECT,
-    .instance_size = sizeof(struct XilinxAXIDMAStreamSlave),
+    .instance_size = sizeof(XilinxAXIDMAStreamSlave),
     .class_init    = xilinx_axidma_stream_class_init,
     .class_data    = &xilinx_axidma_control_stream_class,
     .interfaces = (InterfaceInfo[]) {
Signature · 1 line
2.26.2
Reviewed-by on v1 1/6
#2 lore raw

Re: [PATCH 1/6] xilinx_axidma: Use typedef name for instance_size

Quoted 6 lines · Eduardo Habkost

This makes the code consistent with the rest of QOM code in QEMU, and will make automated conversion to type declaration macros simpler.

Alistair

Quoted 36 lines

---
Cc: "Edgar E. Iglesias" <[email protected]>
Cc: Alistair Francis <[email protected]>
Cc: Peter Maydell <[email protected]>
Cc: [email protected]
Cc: [email protected]

---
 hw/dma/xilinx_axidma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/dma/xilinx_axidma.c +2 -3
index a4812e480a..5ad8bd3d2e 100644
@@ -634,7 +634,7 @@ static const TypeInfo axidma_info = {
 static const TypeInfo xilinx_axidma_data_stream_info = {
     .name          = TYPE_XILINX_AXI_DMA_DATA_STREAM,
     .parent        = TYPE_OBJECT,
-    .instance_size = sizeof(struct XilinxAXIDMAStreamSlave),
+    .instance_size = sizeof(XilinxAXIDMAStreamSlave),
     .class_init    = xilinx_axidma_stream_class_init,
     .class_data    = &xilinx_axidma_data_stream_class,
     .interfaces = (InterfaceInfo[]) {
@@ -646,7 +646,7 @@ static const TypeInfo xilinx_axidma_data_stream_info = {
 static const TypeInfo xilinx_axidma_control_stream_info = {
     .name          = TYPE_XILINX_AXI_DMA_CONTROL_STREAM,
     .parent        = TYPE_OBJECT,
-    .instance_size = sizeof(struct XilinxAXIDMAStreamSlave),
+    .instance_size = sizeof(XilinxAXIDMAStreamSlave),
     .class_init    = xilinx_axidma_stream_class_init,
     .class_data    = &xilinx_axidma_control_stream_class,
     .interfaces = (InterfaceInfo[]) {
--

2.26.2