diff mbox series

[23/23] hw/vfio/platform: Let vfio_start_eventfd_injection() take VFIOPlatformDevice pointer

Message ID 20240923093016.66437-24-shentey@gmail.com (mailing list archive)
State New, archived
Headers show
Series E500 Cleanup | expand

Commit Message

Bernhard Beschow Sept. 23, 2024, 9:30 a.m. UTC
Avoids one downcast, making the code more type-safe.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
 hw/vfio/platform.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Cédric Le Goater Sept. 24, 2024, 8:36 a.m. UTC | #1
On 9/23/24 11:30, Bernhard Beschow wrote:
> Avoids one downcast, making the code more type-safe.
> 
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>

That's a bit unrelated to your e500 series. Anyhow,

Reviewed-by: Cédric Le Goater <clg@redhat.com>


Thanks,

C.


> ---
>   hw/vfio/platform.c | 7 +++----
>   1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c
> index a85c199c76..77bbfbf62c 100644
> --- a/hw/vfio/platform.c
> +++ b/hw/vfio/platform.c
> @@ -318,13 +318,12 @@ static void vfio_platform_eoi(VFIODevice *vbasedev)
>   /**
>    * vfio_start_eventfd_injection - starts the virtual IRQ injection using
>    * user-side handled eventfds
> - * @sbdev: the sysbus device handle
> + * @vdev: the VFIO platform device handle
>    * @irq: the qemu irq handle
>    */
>   
> -static void vfio_start_eventfd_injection(SysBusDevice *sbdev, qemu_irq irq)
> +static void vfio_start_eventfd_injection(VFIOPlatformDevice *vdev, qemu_irq irq)
>   {
> -    VFIOPlatformDevice *vdev = VFIO_PLATFORM_DEVICE(sbdev);
>       VFIOINTp *intp;
>   
>       QLIST_FOREACH(intp, &vdev->intp_list, next) {
> @@ -417,7 +416,7 @@ fail_vfio:
>       kvm_irqchip_remove_irqfd_notifier(kvm_state, intp->interrupt, irq);
>       abort();
>   fail_irqfd:
> -    vfio_start_eventfd_injection(sbdev, irq);
> +    vfio_start_eventfd_injection(vdev, irq);
>       return;
>   }
>
diff mbox series

Patch

diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c
index a85c199c76..77bbfbf62c 100644
--- a/hw/vfio/platform.c
+++ b/hw/vfio/platform.c
@@ -318,13 +318,12 @@  static void vfio_platform_eoi(VFIODevice *vbasedev)
 /**
  * vfio_start_eventfd_injection - starts the virtual IRQ injection using
  * user-side handled eventfds
- * @sbdev: the sysbus device handle
+ * @vdev: the VFIO platform device handle
  * @irq: the qemu irq handle
  */
 
-static void vfio_start_eventfd_injection(SysBusDevice *sbdev, qemu_irq irq)
+static void vfio_start_eventfd_injection(VFIOPlatformDevice *vdev, qemu_irq irq)
 {
-    VFIOPlatformDevice *vdev = VFIO_PLATFORM_DEVICE(sbdev);
     VFIOINTp *intp;
 
     QLIST_FOREACH(intp, &vdev->intp_list, next) {
@@ -417,7 +416,7 @@  fail_vfio:
     kvm_irqchip_remove_irqfd_notifier(kvm_state, intp->interrupt, irq);
     abort();
 fail_irqfd:
-    vfio_start_eventfd_injection(sbdev, irq);
+    vfio_start_eventfd_injection(vdev, irq);
     return;
 }