mbox series

[0/8] qom: Rename macros for consistency (pass 2)

Message ID 20200903180128.1523959-1-ehabkost@redhat.com
Headers show
Series qom: Rename macros for consistency (pass 2) | expand

Message

Eduardo Habkost Sept. 3, 2020, 6:01 p.m. UTC
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/20200902224311.1321159-1-ehabkost@redhat.com/

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(-)

-- 
2.26.2

Comments

Daniel P. Berrangé Sept. 4, 2020, 8:48 a.m. UTC | #1
On Thu, Sep 03, 2020 at 02:01:24PM -0400, Eduardo Habkost wrote:
> Rename the type checking function to be consistent with the type
> name constant (TYPE_ISA_I8259) and the QOM type name string
> ("isa-i8259").
> 
> Suggested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Suggested-by: "Daniel P. Berrangé" <berrange@redhat.com>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: qemu-devel@nongnu.org
> ---
>  hw/intc/i8259.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
Daniel P. Berrangé Sept. 4, 2020, 8:49 a.m. UTC | #2
On Thu, Sep 03, 2020 at 02:01:27PM -0400, Eduardo Habkost wrote:
> Rename the type checking function to be consistent with the type
> name constant (TYPE_AM53C974) and type name string ("am53c974").
> 
> Suggested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Suggested-by: "Daniel P. Berrangé" <berrange@redhat.com>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> Changes v1 -> v2:
> * New patch added to series v2
> ---
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Fam Zheng <fam@euphon.net>
> Cc: qemu-devel@nongnu.org
> ---
>  hw/scsi/esp-pci.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
Daniel P. Berrangé Sept. 4, 2020, 8:50 a.m. UTC | #3
On Thu, Sep 03, 2020 at 02:01:28PM -0400, Eduardo Habkost wrote:
> Make type checking function name consistent with the TYPE_TUSB6010
> constant and QOM type name ("tusb6010").
> 
> Suggested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> Suggested-by: "Daniel P. Berrangé" <berrange@redhat.com>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
> 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 <kraxel@redhat.com>
> Cc: qemu-devel@nongnu.org
> ---
>  hw/usb/tusb6010.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel