Skip to contentSkip to conversation

qom: Rename macros for consistency (pass 2)

PATCH In review Eduardo Habkost 3 participants 18 messages Sep 3, 2020 – Sep 4, 2020

lore
Share & tools
lore
#0 lore raw

cover qom: Rename macros for consistency (pass 2)

Reducing boilerplate QOM code using the new OBJECT_DEFINE_* and OBJECT_DECLARE_* macros is quite difficult when there are multiple ways a TYPE_* constant name is written.

This series renames many type checking macros and/or TYPE_* constants to make sure they are consistent.

This is a second pass of cleanups, incorporating suggestions Philippe and Daniel sent when reviewing the previous series[1].

This series is based on machine-next and can be fetched from:

https://github.com/ehabkost/qemu-hacks work/qom-rename-macros-pass2

[1] https://lore.kernel.org/qemu-devel/[email protected]/

Eduardo Habkost (8):
i8254: Rename TYPE_I8254 to TYPE_ISA_PIT
i8254: Rename PIT to ISA_PIT
i8259: Rename TYPE_I8259 to TYPE_ISA_I8259
i8259: Rename PIC to ISA_I8259
i8259: Rename KVM_PIC to KVM_I8259
esp-pci: Rename TYPE_AM53C974_DEVICE to TYPE_AM53C974
esp-pci: Rename PCI_ESP to AM53C974
tusb6010: Rename TUSB to TUSB6010

 include/hw/timer/i8254.h |  4 ++--
 hw/i386/kvm/i8259.c      |  6 +++---
 hw/intc/i8259.c          | 16 ++++++++--------
 hw/scsi/esp-pci.c        | 16 ++++++++--------
 hw/timer/i8254.c         | 10 +++++-----
 hw/usb/tusb6010.c        |  6 +++---
 6 files changed, 29 insertions(+), 29 deletions(-)
Signature · 1 line
2.26.2
#1 lore raw

PATCH 1/8 i8254: Rename TYPE_I8254 to TYPE_ISA_PIT

This will make the type name constant consistent with the name of the QOM type ("isa-pit").

---
Changes v1 -> v2:
* v1 subject was: "i8254: Rename TYPE_I8254 to TYPE_PIT"
* Rename it to TYPE_ISA_PIT instead of TYPE_PIT, to be consistent with the existing "isa-pit" type name
---
Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: [email protected]

---
 include/hw/timer/i8254.h | 4 ++--
 hw/timer/i8254.c         | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
include/hw/timer/i8254.h +2 -2
index 1a522a2457..b21e67c124 100644
@@ -45,7 +45,7 @@ typedef struct PITCommonClass PITCommonClass;
 DECLARE_OBJ_CHECKERS(PITCommonState, PITCommonClass,
                      PIT_COMMON, TYPE_PIT_COMMON)
 
-#define TYPE_I8254 "isa-pit"
+#define TYPE_ISA_PIT "isa-pit"
 #define TYPE_KVM_I8254 "kvm-pit"
 
 static inline ISADevice *i8254_pit_init(ISABus *bus, int base, int isa_irq,
@@ -54,7 +54,7 @@ static inline ISADevice *i8254_pit_init(ISABus *bus, int base, int isa_irq,
     DeviceState *dev;
     ISADevice *d;
 
-    d = isa_new(TYPE_I8254);
+    d = isa_new(TYPE_ISA_PIT);
     dev = DEVICE(d);
     qdev_prop_set_uint32(dev, "iobase", base);
     isa_realize_and_unref(d, bus, &error_fatal);
hw/timer/i8254.c +2 -2
index c01ee2c72a..5666bcb4ef 100644
@@ -39,7 +39,7 @@
 
 typedef struct PITClass PITClass;
 DECLARE_CLASS_CHECKERS(PITClass, PIT,
-                       TYPE_I8254)
+                       TYPE_ISA_PIT)
 
 struct PITClass {
     PITCommonClass parent_class;
@@ -370,7 +370,7 @@ static void pit_class_initfn(ObjectClass *klass, void *data)
 }
 
 static const TypeInfo pit_info = {
-    .name          = TYPE_I8254,
+    .name          = TYPE_ISA_PIT,
     .parent        = TYPE_PIT_COMMON,
     .instance_size = sizeof(PITCommonState),
     .class_init    = pit_class_initfn,
Signature · 1 line
2.26.2
Reviewed-by on v1 1/8
#2 lore raw

Re: [PATCH 1/8] i8254: Rename TYPE_I8254 to TYPE_ISA_PIT

Quoted 15 lines · Eduardo Habkost

This will make the type name constant consistent with the name of the QOM type ("isa-pit").

---
Changes v1 -> v2:
* v1 subject was: "i8254: Rename TYPE_I8254 to TYPE_PIT"
* Rename it to TYPE_ISA_PIT instead of TYPE_PIT, to be consistent with the existing "isa-pit" type name
---
Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: [email protected]

Quoted 4 lines
---
 include/hw/timer/i8254.h | 4 ++--
 hw/timer/i8254.c         | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#3 lore raw

PATCH 2/8 i8254: Rename PIT to ISA_PIT

In reply to Eduardo Habkost

Rename type checking function to be consistent with the type name constant (TYPE_ISA_PIT) and type name string ("isa-pit").

---
Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: [email protected]

---
 hw/timer/i8254.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
hw/timer/i8254.c +3 -3
index 5666bcb4ef..3f63e7b936 100644
@@ -38,7 +38,7 @@
 #define RW_STATE_WORD1 4
 
 typedef struct PITClass PITClass;
-DECLARE_CLASS_CHECKERS(PITClass, PIT,
+DECLARE_CLASS_CHECKERS(PITClass, ISA_PIT,
                        TYPE_ISA_PIT)
 
 struct PITClass {
@@ -334,7 +334,7 @@ static void pit_post_load(PITCommonState *s)
 static void pit_realizefn(DeviceState *dev, Error **errp)
 {
     PITCommonState *pit = PIT_COMMON(dev);
-    PITClass *pc = PIT_GET_CLASS(dev);
+    PITClass *pc = ISA_PIT_GET_CLASS(dev);
     PITChannelState *s;
 
     s = &pit->channels[0];
@@ -357,7 +357,7 @@ static Property pit_properties[] = {
 
 static void pit_class_initfn(ObjectClass *klass, void *data)
 {
-    PITClass *pc = PIT_CLASS(klass);
+    PITClass *pc = ISA_PIT_CLASS(klass);
     PITCommonClass *k = PIT_COMMON_CLASS(klass);
     DeviceClass *dc = DEVICE_CLASS(klass);
 
Signature · 1 line
2.26.2
Reviewed-by on v1 2/8
#4 lore raw

Re: [PATCH 2/8] i8254: Rename PIT to ISA_PIT

Quoted 5 lines · Eduardo Habkost

Rename type checking function to be consistent with the type name constant (TYPE_ISA_PIT) and type name string ("isa-pit").

Quoted 7 lines

---
Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: [email protected]

---
 hw/timer/i8254.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#5 lore raw

PATCH 3/8 i8259: Rename TYPE_I8259 to TYPE_ISA_I8259

In reply to Eduardo Habkost

This will make the type name constant consistent with QOM type name string ("isa-i8259").

---
Changes v1 ->v2:
* v1 subject was "i8259: Rename TYPE_I8259 to TYPE_PIC"
* Rename it to TYPE_ISA_I8259 instead, to be consistent with the QOM type name ("isa-i8259")
---
Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: [email protected]

---
 hw/intc/i8259.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
hw/intc/i8259.c +5 -5
index 344fd04db1..ab55163340 100644
@@ -37,10 +37,10 @@
 
 //#define DEBUG_IRQ_LATENCY
 
-#define TYPE_I8259 "isa-i8259"
+#define TYPE_ISA_I8259 "isa-i8259"
 typedef struct PICClass PICClass;
 DECLARE_CLASS_CHECKERS(PICClass, PIC,
-                       TYPE_I8259)
+                       TYPE_ISA_I8259)
 
 /**
  * PICClass:
@@ -418,7 +418,7 @@ qemu_irq *i8259_init(ISABus *bus, qemu_irq parent_irq)
 
     irq_set = g_new0(qemu_irq, ISA_NUM_IRQS);
 
-    isadev = i8259_init_chip(TYPE_I8259, bus, true);
+    isadev = i8259_init_chip(TYPE_ISA_I8259, bus, true);
     dev = DEVICE(isadev);
 
     qdev_connect_gpio_out(dev, 0, parent_irq);
@@ -428,7 +428,7 @@ qemu_irq *i8259_init(ISABus *bus, qemu_irq parent_irq)
 
     isa_pic = dev;
 
-    isadev = i8259_init_chip(TYPE_I8259, bus, false);
+    isadev = i8259_init_chip(TYPE_ISA_I8259, bus, false);
     dev = DEVICE(isadev);
 
     qdev_connect_gpio_out(dev, 0, irq_set[2]);
@@ -451,7 +451,7 @@ static void i8259_class_init(ObjectClass *klass, void *data)
 }
 
 static const TypeInfo i8259_info = {
-    .name       = TYPE_I8259,
+    .name       = TYPE_ISA_I8259,
     .instance_size = sizeof(PICCommonState),
     .parent     = TYPE_PIC_COMMON,
     .class_init = i8259_class_init,
Signature · 1 line
2.26.2
Reviewed-by on v1 3/8
#6 lore raw

Re: [PATCH 3/8] i8259: Rename TYPE_I8259 to TYPE_ISA_I8259

Quoted 15 lines · Eduardo Habkost

This will make the type name constant consistent with QOM type name string ("isa-i8259").

---
Changes v1 ->v2:
* v1 subject was "i8259: Rename TYPE_I8259 to TYPE_PIC"
* Rename it to TYPE_ISA_I8259 instead, to be consistent with the QOM type name ("isa-i8259")
---
Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: [email protected]

Quoted 3 lines
---
 hw/intc/i8259.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#7 lore raw

PATCH 4/8 i8259: Rename PIC to ISA_I8259

In reply to Eduardo Habkost

Rename the type checking function to be consistent with the type name constant (TYPE_ISA_I8259) and the QOM type name string ("isa-i8259").

---
Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: [email protected]

---
 hw/intc/i8259.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
hw/intc/i8259.c +3 -3
index ab55163340..61422e6fef 100644
@@ -39,7 +39,7 @@
 
 #define TYPE_ISA_I8259 "isa-i8259"
 typedef struct PICClass PICClass;
-DECLARE_CLASS_CHECKERS(PICClass, PIC,
+DECLARE_CLASS_CHECKERS(PICClass, ISA_I8259,
                        TYPE_ISA_I8259)
 
 /**
@@ -396,7 +396,7 @@ static const MemoryRegionOps pic_elcr_ioport_ops = {
 static void pic_realize(DeviceState *dev, Error **errp)
 {
     PICCommonState *s = PIC_COMMON(dev);
-    PICClass *pc = PIC_GET_CLASS(dev);
+    PICClass *pc = ISA_I8259_GET_CLASS(dev);
 
     memory_region_init_io(&s->base_io, OBJECT(s), &pic_base_ioport_ops, s,
                           "pic", 2);
@@ -443,7 +443,7 @@ qemu_irq *i8259_init(ISABus *bus, qemu_irq parent_irq)
 
 static void i8259_class_init(ObjectClass *klass, void *data)
 {
-    PICClass *k = PIC_CLASS(klass);
+    PICClass *k = ISA_I8259_CLASS(klass);
     DeviceClass *dc = DEVICE_CLASS(klass);
 
     device_class_set_parent_realize(dc, pic_realize, &k->parent_realize);
Signature · 1 line
2.26.2
Reviewed-by on v1 4/8
#8 lore raw

Re: [PATCH 4/8] i8259: Rename PIC to ISA_I8259

Quoted 7 lines · Eduardo Habkost

Rename the type checking function to be consistent with the type name constant (TYPE_ISA_I8259) and the QOM type name string ("isa-i8259").

Quoted 7 lines

---
Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: [email protected]

---
 hw/intc/i8259.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#9 lore raw

PATCH 5/8 i8259: Rename KVM_PIC to KVM_I8259

In reply to Eduardo Habkost

Rename the type checking function to be consistent with the type name constant (TYPE_KVM_I8259) and type name string ("kvm-i8259").

---
Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Marcel Apfelbaum <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: Eduardo Habkost <[email protected]>
Cc: [email protected]

---
 hw/i386/kvm/i8259.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
hw/i386/kvm/i8259.c +3 -3
index 3f8bf69e9c..46a1d31b1b 100644
@@ -21,7 +21,7 @@
 
 #define TYPE_KVM_I8259 "kvm-i8259"
 typedef struct KVMPICClass KVMPICClass;
-DECLARE_CLASS_CHECKERS(KVMPICClass, KVM_PIC,
+DECLARE_CLASS_CHECKERS(KVMPICClass, KVM_I8259,
                        TYPE_KVM_I8259)
 
 /**
@@ -123,7 +123,7 @@ static void kvm_pic_set_irq(void *opaque, int irq, int level)
 static void kvm_pic_realize(DeviceState *dev, Error **errp)
 {
     PICCommonState *s = PIC_COMMON(dev);
-    KVMPICClass *kpc = KVM_PIC_GET_CLASS(dev);
+    KVMPICClass *kpc = KVM_I8259_GET_CLASS(dev);
 
     memory_region_init_io(&s->base_io, OBJECT(dev), NULL, NULL, "kvm-pic", 2);
     memory_region_init_io(&s->elcr_io, OBJECT(dev), NULL, NULL, "kvm-elcr", 1);
@@ -141,7 +141,7 @@ qemu_irq *kvm_i8259_init(ISABus *bus)
 
 static void kvm_i8259_class_init(ObjectClass *klass, void *data)
 {
-    KVMPICClass *kpc = KVM_PIC_CLASS(klass);
+    KVMPICClass *kpc = KVM_I8259_CLASS(klass);
     PICCommonClass *k = PIC_COMMON_CLASS(klass);
     DeviceClass *dc = DEVICE_CLASS(klass);
 
Signature · 1 line
2.26.2
Reviewed-by on v1 5/8
#10 lore raw

Re: [PATCH 5/8] i8259: Rename KVM_PIC to KVM_I8259

Quoted 14 lines · Eduardo Habkost

Rename the type checking function to be consistent with the type name constant (TYPE_KVM_I8259) and type name string ("kvm-i8259").

---
Cc: "Michael S. Tsirkin" <[email protected]>
Cc: Marcel Apfelbaum <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: Richard Henderson <[email protected]>
Cc: Eduardo Habkost <[email protected]>
Cc: [email protected]

Quoted 3 lines
---
 hw/i386/kvm/i8259.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#11 lore raw

PATCH 6/8 esp-pci: Rename TYPE_AM53C974_DEVICE to TYPE_AM53C974

In reply to Eduardo Habkost

This will make the type name constant consistent with the QOM type name string ("am53c974").

---
Changes v1 -> v2:
* v1 subject was "scsi: Rename TYPE_AM53C974_DEVICE to TYPE_PCI_ESP"
* Rename it to TYPE_AM53C974 instead, to be consistent with QOM type name ("am53c974")
---
Cc: Paolo Bonzini <[email protected]>
Cc: Fam Zheng <[email protected]>
Cc: [email protected]

---
 hw/scsi/esp-pci.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
hw/scsi/esp-pci.c +4 -4
index 2ce96dc56e..e30a911b21 100644
@@ -35,11 +35,11 @@
 #include "qemu/module.h"
 #include "qom/object.h"
 
-#define TYPE_AM53C974_DEVICE "am53c974"
+#define TYPE_AM53C974 "am53c974"
 
 typedef struct PCIESPState PCIESPState;
 DECLARE_INSTANCE_CHECKER(PCIESPState, PCI_ESP,
-                         TYPE_AM53C974_DEVICE)
+                         TYPE_AM53C974)
 
 #define DMA_CMD   0x0
 #define DMA_STC   0x1
@@ -400,7 +400,7 @@ static void esp_pci_class_init(ObjectClass *klass, void *data)
 }
 
 static const TypeInfo esp_pci_info = {
-    .name = TYPE_AM53C974_DEVICE,
+    .name = TYPE_AM53C974,
     .parent = TYPE_PCI_DEVICE,
     .instance_size = sizeof(PCIESPState),
     .class_init = esp_pci_class_init,
@@ -525,7 +525,7 @@ static void dc390_class_init(ObjectClass *klass, void *data)
 
 static const TypeInfo dc390_info = {
     .name = TYPE_DC390_DEVICE,
-    .parent = TYPE_AM53C974_DEVICE,
+    .parent = TYPE_AM53C974,
     .instance_size = sizeof(DC390State),
     .class_init = dc390_class_init,
 };
Signature · 1 line
2.26.2
Reviewed-by on v1 6/8
#12 lore raw

Re: [PATCH 6/8] esp-pci: Rename TYPE_AM53C974_DEVICE to TYPE_AM53C974

Quoted 15 lines · Eduardo Habkost

This will make the type name constant consistent with the QOM type name string ("am53c974").

---
Changes v1 -> v2:
* v1 subject was "scsi: Rename TYPE_AM53C974_DEVICE to TYPE_PCI_ESP"
* Rename it to TYPE_AM53C974 instead, to be consistent with QOM type name ("am53c974")
---
Cc: Paolo Bonzini <[email protected]>
Cc: Fam Zheng <[email protected]>
Cc: [email protected]

Quoted 3 lines
---
 hw/scsi/esp-pci.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#13 lore raw

PATCH 7/8 esp-pci: Rename PCI_ESP to AM53C974

In reply to Eduardo Habkost

Rename the type checking function to be consistent with the type name constant (TYPE_AM53C974) and type name string ("am53c974").

---
Changes v1 -> v2:
* New patch added to series v2
---
Cc: Paolo Bonzini <[email protected]>
Cc: Fam Zheng <[email protected]>
Cc: [email protected]

---
 hw/scsi/esp-pci.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
hw/scsi/esp-pci.c +4 -4
index e30a911b21..117383037e 100644
@@ -38,7 +38,7 @@
 #define TYPE_AM53C974 "am53c974"
 
 typedef struct PCIESPState PCIESPState;
-DECLARE_INSTANCE_CHECKER(PCIESPState, PCI_ESP,
+DECLARE_INSTANCE_CHECKER(PCIESPState, AM53C974,
                          TYPE_AM53C974)
 
 #define DMA_CMD   0x0
@@ -305,7 +305,7 @@ static const MemoryRegionOps esp_pci_io_ops = {
 
 static void esp_pci_hard_reset(DeviceState *dev)
 {
-    PCIESPState *pci = PCI_ESP(dev);
+    PCIESPState *pci = AM53C974(dev);
     esp_hard_reset(&pci->esp);
     pci->dma_regs[DMA_CMD] &= ~(DMA_CMD_DIR | DMA_CMD_INTE_D | DMA_CMD_INTE_P
                               | DMA_CMD_MDL | DMA_CMD_DIAG | DMA_CMD_MASK);
@@ -352,7 +352,7 @@ static const struct SCSIBusInfo esp_pci_scsi_info = {
 
 static void esp_pci_scsi_realize(PCIDevice *dev, Error **errp)
 {
-    PCIESPState *pci = PCI_ESP(dev);
+    PCIESPState *pci = AM53C974(dev);
     DeviceState *d = DEVICE(dev);
     ESPState *s = &pci->esp;
     uint8_t *pci_conf;
@@ -377,7 +377,7 @@ static void esp_pci_scsi_realize(PCIDevice *dev, Error **errp)
 
 static void esp_pci_scsi_uninit(PCIDevice *d)
 {
-    PCIESPState *pci = PCI_ESP(d);
+    PCIESPState *pci = AM53C974(d);
 
     qemu_free_irq(pci->esp.irq);
 }
Signature · 1 line
2.26.2
Reviewed-by on v1 7/8
#14 lore raw

Re: [PATCH 7/8] esp-pci: Rename PCI_ESP to AM53C974

Quoted 13 lines · Eduardo Habkost

Rename the type checking function to be consistent with the type name constant (TYPE_AM53C974) and type name string ("am53c974").

---
Changes v1 -> v2:
* New patch added to series v2
---
Cc: Paolo Bonzini <[email protected]>
Cc: Fam Zheng <[email protected]>
Cc: [email protected]

Quoted 3 lines
---
 hw/scsi/esp-pci.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#15 lore raw

PATCH 8/8 tusb6010: Rename TUSB to TUSB6010

In reply to Eduardo Habkost

Make type checking function name consistent with the TYPE_TUSB6010 constant and QOM type name ("tusb6010").

---
Changes v1 -> v2:
* v1 subject was "tusb6010: Rename TYPE_TUSB6010 to TYPE_TUSB"
* Rename TUSB macro to TUSB6010 instead, to keep it consistent with the QOM type name ("tusb6010")
---
Cc: Gerd Hoffmann <[email protected]>
Cc: [email protected]

---
 hw/usb/tusb6010.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
hw/usb/tusb6010.c +3 -3
index 2bee3ae59f..dd20996d13 100644
@@ -32,7 +32,7 @@
 
 #define TYPE_TUSB6010 "tusb6010"
 typedef struct TUSBState TUSBState;
-DECLARE_INSTANCE_CHECKER(TUSBState, TUSB,
+DECLARE_INSTANCE_CHECKER(TUSBState, TUSB6010,
                          TYPE_TUSB6010)
 
 struct TUSBState {
@@ -779,7 +779,7 @@ static void tusb6010_irq(void *opaque, int source, int level)
 
 static void tusb6010_reset(DeviceState *dev)
 {
-    TUSBState *s = TUSB(dev);
+    TUSBState *s = TUSB6010(dev);
     int i;
 
     s->test_reset = TUSB_PROD_TEST_RESET_VAL;
@@ -815,7 +815,7 @@ static void tusb6010_reset(DeviceState *dev)
 
 static void tusb6010_realize(DeviceState *dev, Error **errp)
 {
-    TUSBState *s = TUSB(dev);
+    TUSBState *s = TUSB6010(dev);
     SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
 
     s->otg_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, tusb_otg_tick, s);
Signature · 1 line
2.26.2
Reviewed-by on v1 8/8
#16 lore raw

Re: [PATCH 8/8] tusb6010: Rename TUSB to TUSB6010

Quoted 11 lines · Eduardo Habkost

Make type checking function name consistent with the TYPE_TUSB6010 constant and QOM type name ("tusb6010").

---
Changes v1 -> v2:
* v1 subject was "tusb6010: Rename TYPE_TUSB6010 to TYPE_TUSB"
* Rename TUSB macro to TUSB6010 instead, to keep it consistent with the QOM type name ("tusb6010")

Thanks!

Reviewed-by on v1 8/8
#17 lore raw

Re: [PATCH 8/8] tusb6010: Rename TUSB to TUSB6010

In reply to Eduardo Habkost
Quoted 14 lines · Eduardo Habkost

Make type checking function name consistent with the TYPE_TUSB6010 constant and QOM type name ("tusb6010").

---
Changes v1 -> v2:
* v1 subject was "tusb6010: Rename TYPE_TUSB6010 to TYPE_TUSB"
* Rename TUSB macro to TUSB6010 instead, to keep it consistent with the QOM type name ("tusb6010")
---
Cc: Gerd Hoffmann <[email protected]>
Cc: [email protected]

Quoted 3 lines
---
 hw/usb/tusb6010.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|