diff mbox series

[12/41] virtio-ccw: Fix definition of VIRTIO_CCW_BUS_GET_CLASS

Message ID 20200813222625.243136-13-ehabkost@redhat.com (mailing list archive)
State New, archived
Headers show
Series qom: Automated conversion of type checking boilerplate | expand

Commit Message

Eduardo Habkost Aug. 13, 2020, 10:25 p.m. UTC
The macro was incorrectly defined using OBJECT_CHECK.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 hw/s390x/virtio-ccw.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Cornelia Huck Aug. 17, 2020, 7:25 a.m. UTC | #1
On Thu, 13 Aug 2020 18:25:56 -0400
Eduardo Habkost <ehabkost@redhat.com> wrote:

> The macro was incorrectly defined using OBJECT_CHECK.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
>  hw/s390x/virtio-ccw.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/s390x/virtio-ccw.h b/hw/s390x/virtio-ccw.h
> index c0e3355248..b281896f7d 100644
> --- a/hw/s390x/virtio-ccw.h
> +++ b/hw/s390x/virtio-ccw.h
> @@ -65,9 +65,9 @@ typedef struct VirtioBusClass VirtioCcwBusClass;
>  
>  #define TYPE_VIRTIO_CCW_BUS "virtio-ccw-bus"
>  #define VIRTIO_CCW_BUS(obj) \
> -     OBJECT_CHECK(VirtioCcwBus, (obj), TYPE_VIRTIO_CCW_BUS)
> +     OBJECT_CHECK(VirtioCcwBusState, (obj), TYPE_VIRTIO_CCW_BUS)
>  #define VIRTIO_CCW_BUS_GET_CLASS(obj) \
> -    OBJECT_CHECK(VirtioCcwBusState, (obj), TYPE_VIRTIO_CCW_BUS)
> +    OBJECT_GET_CLASS(VirtioCcwBusClass, (obj), TYPE_VIRTIO_CCW_BUS)
>  #define VIRTIO_CCW_BUS_CLASS(klass) \
>      OBJECT_CLASS_CHECK(VirtioCcwBusClass, klass, TYPE_VIRTIO_CCW_BUS)
>  

I was wondering why nobody ever noticed, but it seems that the broken
macros were simply unused. If we keep them for completeness' sake, we
should make sure that they are indeed correct :)

Acked-by: Cornelia Huck <cohuck@redhat.com>
Daniel P. Berrangé Aug. 17, 2020, 3:57 p.m. UTC | #2
On Thu, Aug 13, 2020 at 06:25:56PM -0400, Eduardo Habkost wrote:
> The macro was incorrectly defined using OBJECT_CHECK.

Nice demonstration of the benefit of removing this boilerplate
definition !

> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
>  hw/s390x/virtio-ccw.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

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


Regards,
Daniel
diff mbox series

Patch

diff --git a/hw/s390x/virtio-ccw.h b/hw/s390x/virtio-ccw.h
index c0e3355248..b281896f7d 100644
--- a/hw/s390x/virtio-ccw.h
+++ b/hw/s390x/virtio-ccw.h
@@ -65,9 +65,9 @@  typedef struct VirtioBusClass VirtioCcwBusClass;
 
 #define TYPE_VIRTIO_CCW_BUS "virtio-ccw-bus"
 #define VIRTIO_CCW_BUS(obj) \
-     OBJECT_CHECK(VirtioCcwBus, (obj), TYPE_VIRTIO_CCW_BUS)
+     OBJECT_CHECK(VirtioCcwBusState, (obj), TYPE_VIRTIO_CCW_BUS)
 #define VIRTIO_CCW_BUS_GET_CLASS(obj) \
-    OBJECT_CHECK(VirtioCcwBusState, (obj), TYPE_VIRTIO_CCW_BUS)
+    OBJECT_GET_CLASS(VirtioCcwBusClass, (obj), TYPE_VIRTIO_CCW_BUS)
 #define VIRTIO_CCW_BUS_CLASS(klass) \
     OBJECT_CLASS_CHECK(VirtioCcwBusClass, klass, TYPE_VIRTIO_CCW_BUS)