Re: [PATCH v3 72/74] [automated] Remove redundant instance_size/class_size fields

2020-08-26 Thread Eduardo Habkost
On Tue, Aug 25, 2020 at 03:21:08PM -0400, Eduardo Habkost wrote:
> This will remove instance_size/class_size fields from TypeInfo
> variables when the value is exactly the same as the one in the
> parent class.
> 
> Generated by:
> 
>  $ ./scripts/codeconverter/converter.py -i \
>--pattern=RedundantTypeSizes $(git grep -l TypeInfo -- '*.[ch]')
> 
> Signed-off-by: Eduardo Habkost 

This patch triggers an assert due to code outside QOM core using
TypeInfo.instance_size directly.  Please ignore it by now.

Thanks to Roman Bolshakov for reporting the problem.

-- 
Eduardo




[PATCH v3 72/74] [automated] Remove redundant instance_size/class_size fields

2020-08-25 Thread Eduardo Habkost
This will remove instance_size/class_size fields from TypeInfo
variables when the value is exactly the same as the one in the
parent class.

Generated by:

 $ ./scripts/codeconverter/converter.py -i \
   --pattern=RedundantTypeSizes $(git grep -l TypeInfo -- '*.[ch]')

Signed-off-by: Eduardo Habkost 
---
Changes series v2 -> v3: this is a new patch in series v3

---
Cc: "Marc-André Lureau" 
Cc: Paolo Bonzini 
Cc: "Daniel P. Berrangé" 
Cc: "Cédric Le Goater" 
Cc: Peter Maydell 
Cc: Andrew Jeffery 
Cc: Joel Stanley 
Cc: Jan Kiszka 
Cc: Eduardo Habkost 
Cc: "Michael S. Tsirkin" 
Cc: Marcel Apfelbaum 
Cc: Richard Henderson 
Cc: Stefano Stabellini 
Cc: Anthony Perard 
Cc: Paul Durrant 
Cc: Gerd Hoffmann 
Cc: Aleksandar Markovic 
Cc: "Philippe Mathieu-Daudé" 
Cc: Aurelien Jarno 
Cc: Jiaxun Yang 
Cc: Aleksandar Rikalo 
Cc: Laurent Vivier 
Cc: Mark Cave-Ayland 
Cc: David Gibson 
Cc: Cornelia Huck 
Cc: Thomas Huth 
Cc: David Hildenbrand 
Cc: Halil Pasic 
Cc: Christian Borntraeger 
Cc: Fam Zheng 
Cc: Beniamino Galvani 
Cc: Andrew Baumann 
Cc: Michael Walle 
Cc: Andrzej Zaborowski 
Cc: Yoshinori Sato 
Cc: Alex Williamson 
Cc: qemu-de...@nongnu.org
Cc: qemu-...@nongnu.org
Cc: xen-de...@lists.xenproject.org
Cc: qemu-...@nongnu.org
Cc: qemu-s3...@nongnu.org
Cc: qemu-block@nongnu.org

---
Cc: "Marc-André Lureau" 
Cc: Paolo Bonzini 
Cc: "Daniel P. Berrangé" 
Cc: "Cédric Le Goater" 
Cc: Peter Maydell 
Cc: Andrew Jeffery 
Cc: Joel Stanley 
Cc: Jan Kiszka 
Cc: Eduardo Habkost 
Cc: "Michael S. Tsirkin" 
Cc: Marcel Apfelbaum 
Cc: Richard Henderson 
Cc: Stefano Stabellini 
Cc: Anthony Perard 
Cc: Paul Durrant 
Cc: Gerd Hoffmann 
Cc: Aleksandar Markovic 
Cc: "Philippe Mathieu-Daudé" 
Cc: Aurelien Jarno 
Cc: Jiaxun Yang 
Cc: Aleksandar Rikalo 
Cc: Laurent Vivier 
Cc: Mark Cave-Ayland 
Cc: David Gibson 
Cc: Cornelia Huck 
Cc: Halil Pasic 
Cc: Christian Borntraeger 
Cc: Thomas Huth 
Cc: David Hildenbrand 
Cc: Fam Zheng 
Cc: Beniamino Galvani 
Cc: Andrew Baumann 
Cc: Michael Walle 
Cc: Andrzej Zaborowski 
Cc: Yoshinori Sato 
Cc: Alex Williamson 
Cc: qemu-de...@nongnu.org
Cc: qemu-...@nongnu.org
Cc: xen-de...@lists.xenproject.org
Cc: qemu-...@nongnu.org
Cc: qemu-s3...@nongnu.org
Cc: qemu-block@nongnu.org
---
 chardev/char-null.c| 1 -
 crypto/tls-cipher-suites.c | 2 --
 hw/arm/aspeed_ast2600.c| 2 --
 hw/arm/aspeed_soc.c| 2 --
 hw/arm/musicpal.c  | 1 -
 hw/core/sysbus.c   | 1 -
 hw/i386/kvm/apic.c | 1 -
 hw/i386/pc_piix.c  | 1 -
 hw/i386/xen/xen_apic.c | 1 -
 hw/input/virtio-input-hid.c| 3 ---
 hw/intc/apic.c | 1 -
 hw/intc/ioapic.c   | 1 -
 hw/isa/isa-bus.c   | 1 -
 hw/mips/gt64xxx_pci.c  | 1 -
 hw/misc/aspeed_scu.c   | 3 ---
 hw/misc/ivshmem.c  | 2 --
 hw/nubus/nubus-bridge.c| 1 -
 hw/pci-bridge/dec.c| 2 --
 hw/pci-bridge/pci_bridge_dev.c | 1 -
 hw/pci-host/grackle.c  | 1 -
 hw/pci-host/uninorth.c | 4 
 hw/pci-host/versatile.c| 1 -
 hw/pci-host/xen_igd_pt.c   | 1 -
 hw/ppc/pnv_homer.c | 2 --
 hw/ppc/pnv_occ.c   | 2 --
 hw/ppc/ppc4xx_pci.c| 1 -
 hw/s390x/s390-skeys-kvm.c  | 2 --
 hw/s390x/sclpcpu.c | 2 --
 hw/s390x/sclpquiesce.c | 2 --
 hw/s390x/tod-kvm.c | 2 --
 hw/s390x/tod-qemu.c| 2 --
 hw/s390x/virtio-ccw-input.c| 3 ---
 hw/scsi/scsi-generic.c | 1 -
 hw/sd/allwinner-sdhost.c   | 1 -
 hw/sd/bcm2835_sdhost.c | 1 -
 hw/sd/milkymist-memcard.c  | 1 -
 hw/sd/pl181.c  | 1 -
 hw/sd/pxa2xx_mmci.c| 1 -
 hw/sd/sdhci.c  | 1 -
 hw/sh4/sh_pci.c| 1 -
 hw/timer/pxa2xx_timer.c| 2 --
 hw/vfio/pci.c  | 1 -
 hw/virtio/virtio-mmio.c| 1 -
 hw/watchdog/wdt_aspeed.c   | 3 ---
 hw/xen/xen-legacy-backend.c| 1 -
 45 files changed, 69 deletions(-)

diff --git a/chardev/char-null.c b/chardev/char-null.c
index ce43ccdda6..2736b2ff2b 100644
--- a/chardev/char-null.c
+++ b/chardev/char-null.c
@@ -44,7 +44,6 @@ static void char_null_class_init(ObjectClass *oc, void *data)
 static const TypeInfo char_null_type_info = {
 .name = TYPE_CHARDEV_NULL,
 .parent = TYPE_CHARDEV,
-.instance_size = sizeof(Chardev),
 .class_init = char_null_class_init,
 };
 TYPE_INFO(char_null_type_info)
diff --git a/crypto/tls-cipher-suites.c b/crypto/tls-cipher-suites.c
index e92a380a24..0c9713d301 100644
--- a/crypto/tls-cipher-suites.c
+++ b/crypto/tls-cipher-suites.c
@@ -108,8 +108,6 @@ static void 
qcrypto_tls_cipher_suites_class_init(ObjectClass *oc, void *data)
 static const TypeInfo qcrypto_tls_cipher_suites_info = {
 .parent = TYPE_QCRYPTO_TLS_CREDS,
 .name = TYPE_QCRYPTO_TLS_CIPHER_SUITES,
-.instance_size = sizeof(QCryptoTLSCreds),
-.class_size = sizeof(QCryptoTLSCredsClass),
 .class_init =