diff mbox series

[15/19] hw/s390x/event-facility: Replace DO_UPCAST(SCLPEvent) by SCLP_EVENT()

Message ID 20230212225144.58660-16-philmd@linaro.org
State Superseded
Headers show
Series hw: Use QOM macros and remove DO_UPCAST() uses | expand

Commit Message

Philippe Mathieu-Daudé Feb. 12, 2023, 10:51 p.m. UTC
Use the SCLP_EVENT() QOM type-checking macro to avoid DO_UPCAST().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/s390x/event-facility.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Thomas Huth Feb. 13, 2023, 12:14 p.m. UTC | #1
On 12/02/2023 23.51, Philippe Mathieu-Daudé wrote:
> Use the SCLP_EVENT() QOM type-checking macro to avoid DO_UPCAST().
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   hw/s390x/event-facility.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/hw/s390x/event-facility.c b/hw/s390x/event-facility.c
> index faa51aa4c7..6891e3cd73 100644
> --- a/hw/s390x/event-facility.c
> +++ b/hw/s390x/event-facility.c
> @@ -64,8 +64,7 @@ static bool event_pending(SCLPEventFacility *ef)
>       SCLPEventClass *event_class;
>   
>       QTAILQ_FOREACH(kid, &ef->sbus.qbus.children, sibling) {
> -        DeviceState *qdev = kid->child;
> -        event = DO_UPCAST(SCLPEvent, qdev, qdev);
> +        event = SCLP_EVENT(kid->child);
>           event_class = SCLP_EVENT_GET_CLASS(event);
>           if (event->event_pending &&
>               event_class->get_send_mask() & ef->receive_mask) {

Reviewed-by: Thomas Huth <thuth@redhat.com>
diff mbox series

Patch

diff --git a/hw/s390x/event-facility.c b/hw/s390x/event-facility.c
index faa51aa4c7..6891e3cd73 100644
--- a/hw/s390x/event-facility.c
+++ b/hw/s390x/event-facility.c
@@ -64,8 +64,7 @@  static bool event_pending(SCLPEventFacility *ef)
     SCLPEventClass *event_class;
 
     QTAILQ_FOREACH(kid, &ef->sbus.qbus.children, sibling) {
-        DeviceState *qdev = kid->child;
-        event = DO_UPCAST(SCLPEvent, qdev, qdev);
+        event = SCLP_EVENT(kid->child);
         event_class = SCLP_EVENT_GET_CLASS(event);
         if (event->event_pending &&
             event_class->get_send_mask() & ef->receive_mask) {