Skip to contentSkip to conversation

hw/virtio: Pass VirtIODevice pointer to virtio_reset()

PATCH New Philippe Mathieu-Daudé 1 participant 1 message Feb 1

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/virtio: Pass VirtIODevice pointer to virtio_reset()

virtio_reset() expects a VirtIODevice pointer, which is what the single caller - virtio_bus_reset - pass. Promote the opaque argument to a plain VirtIODevice.

---
 include/hw/virtio/virtio.h | 2 +-
 hw/virtio/virtio.c         | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)
include/hw/virtio/virtio.h +1 -1
index 27cd98d2fe1..fcaa9b03b4a 100644
@@ -370,7 +370,7 @@ void virtio_queue_set_vector(VirtIODevice *vdev, int n, uint16_t vector);
 int virtio_queue_set_host_notifier_mr(VirtIODevice *vdev, int n,
                                       MemoryRegion *mr, bool assign);
 int virtio_set_status(VirtIODevice *vdev, uint8_t val);
-void virtio_reset(void *opaque);
+void virtio_reset(VirtIODevice *vdev);
 void virtio_queue_reset(VirtIODevice *vdev, uint32_t queue_index);
 void virtio_queue_enable(VirtIODevice *vdev, uint32_t queue_index);
 void virtio_update_irq(VirtIODevice *vdev);
hw/virtio/virtio.c +1 -2
index 3dc9423eae9..86fc0e262f7 100644
@@ -3233,9 +3233,8 @@ int virtio_set_features_ex(VirtIODevice *vdev, const uint64_t *features)
     return ret;
 }
 
-void virtio_reset(void *opaque)
+void virtio_reset(VirtIODevice *vdev)
 {
-    VirtIODevice *vdev = opaque;
     VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev);
     uint64_t features[VIRTIO_FEATURES_NU64S];
     int i;
Signature · 1 line
2.52.0