Message ID | 20200902224311.1321159-1-ehabkost@redhat.com |
---|---|
Headers | show |
Series | qom: Rename macros for consistency | expand |
On 03/09/2020 00.42, Eduardo Habkost wrote: > This will make the type name constant consistent with the name of > the type checking macro. > > Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> > --- > Cc: Cornelia Huck <cohuck@redhat.com> > Cc: Thomas Huth <thuth@redhat.com> > Cc: Christian Borntraeger <borntraeger@de.ibm.com> > Cc: Tony Krowiak <akrowiak@linux.ibm.com> > Cc: Halil Pasic <pasic@linux.ibm.com> > Cc: Pierre Morel <pmorel@linux.ibm.com> > Cc: Alex Williamson <alex.williamson@redhat.com> > Cc: qemu-s390x@nongnu.org > Cc: qemu-devel@nongnu.org > --- > hw/vfio/ap.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/hw/vfio/ap.c b/hw/vfio/ap.c > index 68ed059b39..582c091a24 100644 > --- a/hw/vfio/ap.c > +++ b/hw/vfio/ap.c > @@ -30,7 +30,7 @@ > #include "exec/address-spaces.h" > #include "qom/object.h" > > -#define VFIO_AP_DEVICE_TYPE "vfio-ap" > +#define TYPE_VFIO_AP_DEVICE "vfio-ap" > > struct VFIOAPDevice { > APDevice apdev; > @@ -39,7 +39,7 @@ struct VFIOAPDevice { > typedef struct VFIOAPDevice VFIOAPDevice; > > DECLARE_INSTANCE_CHECKER(VFIOAPDevice, VFIO_AP_DEVICE, > - VFIO_AP_DEVICE_TYPE) > + TYPE_VFIO_AP_DEVICE) > > static void vfio_ap_compute_needs_reset(VFIODevice *vdev) > { > @@ -72,7 +72,7 @@ static VFIOGroup *vfio_ap_get_group(VFIOAPDevice *vapdev, Error **errp) > > if (!group_path) { > error_setg(errp, "%s: no iommu_group found for %s: %s", > - VFIO_AP_DEVICE_TYPE, vapdev->vdev.sysfsdev, gerror->message); > + TYPE_VFIO_AP_DEVICE, vapdev->vdev.sysfsdev, gerror->message); > g_error_free(gerror); > return NULL; > } > @@ -176,7 +176,7 @@ static void vfio_ap_class_init(ObjectClass *klass, void *data) > } > > static const TypeInfo vfio_ap_info = { > - .name = VFIO_AP_DEVICE_TYPE, > + .name = TYPE_VFIO_AP_DEVICE, > .parent = TYPE_AP_DEVICE, > .instance_size = sizeof(VFIOAPDevice), > .class_init = vfio_ap_class_init, > Reviewed-by: Thomas Huth <thuth@redhat.com>
On 9/3/20 12:42 AM, Eduardo Habkost wrote: > This looks like a copy/paste mistake: the instance type checking > macro for TYPE_GPEX_ROOT_DEVICE was named MCH_PCI_DEVICE. > > Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> > --- > Cc: qemu-devel@nongnu.org > --- > include/hw/pci-host/gpex.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/hw/pci-host/gpex.h b/include/hw/pci-host/gpex.h > index e8432eced8..2f4e852eee 100644 > --- a/include/hw/pci-host/gpex.h > +++ b/include/hw/pci-host/gpex.h > @@ -32,7 +32,7 @@ DECLARE_INSTANCE_CHECKER(GPEXHost, GPEX_HOST, > > #define TYPE_GPEX_ROOT_DEVICE "gpex-root" > typedef struct GPEXRootState GPEXRootState; > -DECLARE_INSTANCE_CHECKER(GPEXRootState, MCH_PCI_DEVICE, > +DECLARE_INSTANCE_CHECKER(GPEXRootState, GPEX_ROOT_DEVICE, > TYPE_GPEX_ROOT_DEVICE) Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> > > #define GPEX_NUM_IRQS 4 >
On 9/3/20 12:42 AM, Eduardo Habkost wrote: > This will make the type name constant consistent with the name of > the type checking macro. > > Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> > --- > Cc: "Michael S. Tsirkin" <mst@redhat.com> > Cc: Marcel Apfelbaum <marcel.apfelbaum@gmail.com> > Cc: Paolo Bonzini <pbonzini@redhat.com> > Cc: Richard Henderson <rth@twiddle.net> > Cc: Eduardo Habkost <ehabkost@redhat.com> > Cc: qemu-devel@nongnu.org > --- > hw/i386/kvm/i8259.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/hw/i386/kvm/i8259.c b/hw/i386/kvm/i8259.c > index 3f8bf69e9c..687c0cd536 100644 > --- a/hw/i386/kvm/i8259.c > +++ b/hw/i386/kvm/i8259.c > @@ -19,10 +19,10 @@ > #include "sysemu/kvm.h" > #include "qom/object.h" > > -#define TYPE_KVM_I8259 "kvm-i8259" > +#define TYPE_KVM_PIC "kvm-i8259" I disagree with this patch, as we have various KVM INTC and only one KVM_I8259. TYPE_KVM_ARM_GIC and TYPE_KVM_S390_FLIC are kind of TYPE_KVM_INTC ... Can we rename it KVM_I8259_PIC? > typedef struct KVMPICClass KVMPICClass; > DECLARE_CLASS_CHECKERS(KVMPICClass, KVM_PIC, > - TYPE_KVM_I8259) > + TYPE_KVM_PIC) > > /** > * KVMPICClass: > @@ -133,8 +133,8 @@ static void kvm_pic_realize(DeviceState *dev, Error **errp) > > qemu_irq *kvm_i8259_init(ISABus *bus) > { > - i8259_init_chip(TYPE_KVM_I8259, bus, true); > - i8259_init_chip(TYPE_KVM_I8259, bus, false); > + i8259_init_chip(TYPE_KVM_PIC, bus, true); > + i8259_init_chip(TYPE_KVM_PIC, bus, false); > > return qemu_allocate_irqs(kvm_pic_set_irq, NULL, ISA_NUM_IRQS); > } > @@ -152,7 +152,7 @@ static void kvm_i8259_class_init(ObjectClass *klass, void *data) > } > > static const TypeInfo kvm_i8259_info = { > - .name = TYPE_KVM_I8259, > + .name = TYPE_KVM_PIC, > .parent = TYPE_PIC_COMMON, > .instance_size = sizeof(PICCommonState), > .class_init = kvm_i8259_class_init, >
On 9/3/20 12:42 AM, Eduardo Habkost wrote: > Rename macros to names that are unique in the source tree, to > reduce confusion and make automated conversion of the code > easier. > > Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> > --- > Cc: Jason Wang <jasowang@redhat.com> > Cc: qemu-devel@nongnu.org > --- > hw/net/can/can_kvaser_pci.c | 6 +++--- > hw/net/can/can_mioe3680_pci.c | 6 +++--- > hw/net/can/can_pcm3680_pci.c | 6 +++--- > 3 files changed, 9 insertions(+), 9 deletions(-) > > diff --git a/hw/net/can/can_kvaser_pci.c b/hw/net/can/can_kvaser_pci.c > index 168b3a620d..12d4f8df33 100644 > --- a/hw/net/can/can_kvaser_pci.c > +++ b/hw/net/can/can_kvaser_pci.c > @@ -45,11 +45,11 @@ > #include "can_sja1000.h" > #include "qom/object.h" > > -#define TYPE_CAN_PCI_DEV "kvaser_pci" > +#define TYPE_KVASER_PCI "kvaser_pci" Why keep "PCI" and not keep the "CAN" part? To be consistent we should use both busses or none. [...]
On Thu, Sep 03, 2020 at 03:01:33PM +0200, Philippe Mathieu-Daudé wrote: > On 9/3/20 12:42 AM, Eduardo Habkost wrote: > > Make the type checking macro name consistent with the TYPE_* > > constant. > > > > Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> > > --- > > Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> > > Cc: Laurent Vivier <laurent@vivier.eu> > > Cc: "Hervé Poussineau" <hpoussin@reactos.org> > > Cc: Aleksandar Rikalo <aleksandar.rikalo@syrmia.com> > > Cc: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com> > > Cc: Aurelien Jarno <aurelien@aurel32.net> > > Cc: Jiaxun Yang <jiaxun.yang@flygoat.com> > > Cc: Paolo Bonzini <pbonzini@redhat.com> > > Cc: Fam Zheng <fam@euphon.net> > > Cc: Artyom Tarasenko <atar4qemu@gmail.com> > > Cc: qemu-devel@nongnu.org > > --- > > include/hw/scsi/esp.h | 2 +- > > hw/dma/sparc32_dma.c | 2 +- > > hw/m68k/q800.c | 2 +- > > hw/mips/jazz.c | 2 +- > > hw/scsi/esp.c | 6 +++--- > > hw/sparc/sun4m.c | 2 +- > > 6 files changed, 8 insertions(+), 8 deletions(-) > > > > diff --git a/include/hw/scsi/esp.h b/include/hw/scsi/esp.h > > index f281625dd5..20800dbf5b 100644 > > --- a/include/hw/scsi/esp.h > > +++ b/include/hw/scsi/esp.h > > @@ -67,7 +67,7 @@ struct ESPState { > > > > #define TYPE_ESP "esp" > > typedef struct SysBusESPState SysBusESPState; > > -DECLARE_INSTANCE_CHECKER(SysBusESPState, ESP_STATE, > > +DECLARE_INSTANCE_CHECKER(SysBusESPState, ESP, > > TYPE_ESP) > > "ESPDMA" would less likely clash with eventual 'ESP' definition. I want to make the changes less intrusive as possible. If the macro is already called ESP and the type name string is already "esp", I will just keep the existing naming.
On Wed, Sep 02, 2020 at 06:42:54PM -0400, Eduardo Habkost wrote: > This will make the type name constant consistent with the name of > the type checking macro. > > Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> > --- > Cc: Yoshinori Sato <ysato@users.sourceforge.jp> > Cc: Magnus Damm <magnus.damm@gmail.com> > Cc: qemu-devel@nongnu.org > --- [...] > -#define TYPE_RENESAS_TMR "renesas-tmr" > +#define TYPE_RTMR "renesas-tmr" > typedef struct RTMRState RTMRState; > -DECLARE_INSTANCE_CHECKER(RTMRState, RTMR, > - TYPE_RENESAS_TMR) > +DECLARE_INSTANCE_CHECKER(RTMRState, RENESAS_TMR, > + TYPE_RTMR) Please ignore this patch. I've made a mistake while rebasing the series and accidentally squashed in a commit that renamed TYPE_RENESAS_TMR to TYPE_RTMR.
On Wed, 2 Sep 2020 18:42:16 -0400 Eduardo Habkost <ehabkost@redhat.com> wrote: > This will make the type name constant consistent with the name of > the type checking macro. > > Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> > --- > Cc: Cornelia Huck <cohuck@redhat.com> > Cc: Thomas Huth <thuth@redhat.com> > Cc: Christian Borntraeger <borntraeger@de.ibm.com> > Cc: Tony Krowiak <akrowiak@linux.ibm.com> > Cc: Halil Pasic <pasic@linux.ibm.com> > Cc: Pierre Morel <pmorel@linux.ibm.com> > Cc: Alex Williamson <alex.williamson@redhat.com> > Cc: qemu-s390x@nongnu.org > Cc: qemu-devel@nongnu.org > --- > hw/vfio/ap.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) Acked-by: Cornelia Huck <cohuck@redhat.com>
On Wed, Sep 02, 2020 at 06:43:05PM -0400, Eduardo Habkost wrote: > Make the type checking macro name consistent with the TYPE_* > constant. > > Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Anthony PERARD <anthony.perard@citrix.com> Thanks, -- Anthony PERARD
On 9/3/20 12:42 AM, Eduardo Habkost wrote: > This will make the type name constant consistent with the name of > the type checking macro. > > Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> > --- > Cc: Paul Burton <paulburton@kernel.org> > Cc: Aleksandar Rikalo <aleksandar.rikalo@syrmia.com> > Cc: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com> > Cc: Aurelien Jarno <aurelien@aurel32.net> > Cc: Jiaxun Yang <jiaxun.yang@flygoat.com> > Cc: qemu-devel@nongnu.org > --- > hw/mips/boston.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> And queued to mips-next, thanks. Phil.