From 30b5707c269cac1ad80b72f777e52c8e08b2ff19 Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Wed, 16 Sep 2020 14:25:17 -0400 Subject: qom: Remove module_obj_name parameter from OBJECT_DECLARE* macros MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit One of the goals of having less boilerplate on QOM declarations is to avoid human error. Requiring an extra argument that is never used is an opportunity for mistakes. Remove the unused argument from OBJECT_DECLARE_TYPE and OBJECT_DECLARE_SIMPLE_TYPE. Coccinelle patch used to convert all users of the macros: @@ declarer name OBJECT_DECLARE_TYPE; identifier InstanceType, ClassType, lowercase, UPPERCASE; @@ OBJECT_DECLARE_TYPE(InstanceType, ClassType, - lowercase, UPPERCASE); @@ declarer name OBJECT_DECLARE_SIMPLE_TYPE; identifier InstanceType, lowercase, UPPERCASE; @@ OBJECT_DECLARE_SIMPLE_TYPE(InstanceType, - lowercase, UPPERCASE); Signed-off-by: Eduardo Habkost Reviewed-by: Cédric Le Goater Acked-by: Cornelia Huck Acked-by: Igor Mammedov Acked-by: Paul Durrant Acked-by: Thomas Huth Message-Id: <20200916182519.415636-4-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost --- include/hw/virtio/virtio-gpu.h | 2 +- include/hw/virtio/virtio-input.h | 2 +- include/hw/virtio/virtio-mem.h | 2 +- include/hw/virtio/virtio-pmem.h | 2 +- include/hw/virtio/virtio-serial.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'include/hw/virtio') diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h index 6b45b47..7ef4059 100644 --- a/include/hw/virtio/virtio-gpu.h +++ b/include/hw/virtio/virtio-gpu.h @@ -26,7 +26,7 @@ #define TYPE_VIRTIO_GPU_BASE "virtio-gpu-base" OBJECT_DECLARE_TYPE(VirtIOGPUBase, VirtIOGPUBaseClass, - virtio_gpu_base, VIRTIO_GPU_BASE) + VIRTIO_GPU_BASE) #define TYPE_VIRTIO_GPU "virtio-gpu-device" typedef struct VirtIOGPU VirtIOGPU; diff --git a/include/hw/virtio/virtio-input.h b/include/hw/virtio/virtio-input.h index 5eb9e77..91df34b 100644 --- a/include/hw/virtio/virtio-input.h +++ b/include/hw/virtio/virtio-input.h @@ -20,7 +20,7 @@ typedef struct virtio_input_event virtio_input_event; #define TYPE_VIRTIO_INPUT "virtio-input-device" OBJECT_DECLARE_TYPE(VirtIOInput, VirtIOInputClass, - virtio_input, VIRTIO_INPUT) + VIRTIO_INPUT) #define VIRTIO_INPUT_GET_PARENT_CLASS(obj) \ OBJECT_GET_PARENT_CLASS(obj, TYPE_VIRTIO_INPUT) diff --git a/include/hw/virtio/virtio-mem.h b/include/hw/virtio/virtio-mem.h index dfc72e1..4eeb82d 100644 --- a/include/hw/virtio/virtio-mem.h +++ b/include/hw/virtio/virtio-mem.h @@ -22,7 +22,7 @@ #define TYPE_VIRTIO_MEM "virtio-mem" OBJECT_DECLARE_TYPE(VirtIOMEM, VirtIOMEMClass, - virtio_mem, VIRTIO_MEM) + VIRTIO_MEM) #define VIRTIO_MEM_MEMDEV_PROP "memdev" #define VIRTIO_MEM_NODE_PROP "node" diff --git a/include/hw/virtio/virtio-pmem.h b/include/hw/virtio/virtio-pmem.h index 56df9a0..66b5908 100644 --- a/include/hw/virtio/virtio-pmem.h +++ b/include/hw/virtio/virtio-pmem.h @@ -21,7 +21,7 @@ #define TYPE_VIRTIO_PMEM "virtio-pmem" OBJECT_DECLARE_TYPE(VirtIOPMEM, VirtIOPMEMClass, - virtio_pmem, VIRTIO_PMEM) + VIRTIO_PMEM) #define VIRTIO_PMEM_ADDR_PROP "memaddr" #define VIRTIO_PMEM_MEMDEV_PROP "memdev" diff --git a/include/hw/virtio/virtio-serial.h b/include/hw/virtio/virtio-serial.h index 0b7f963..1735991 100644 --- a/include/hw/virtio/virtio-serial.h +++ b/include/hw/virtio/virtio-serial.h @@ -27,7 +27,7 @@ struct virtio_serial_conf { #define TYPE_VIRTIO_SERIAL_PORT "virtio-serial-port" OBJECT_DECLARE_TYPE(VirtIOSerialPort, VirtIOSerialPortClass, - virtio_serial_port, VIRTIO_SERIAL_PORT) + VIRTIO_SERIAL_PORT) typedef struct VirtIOSerial VirtIOSerial; -- cgit v1.1