From d1e9e646298c6635fe84db7af35c1d16e9e8eb8f Mon Sep 17 00:00:00 2001 From: Rebecca Cran Date: Fri, 18 Mar 2022 04:11:24 -0600 Subject: [PATCH 1/2] hw/pci/pci.c: Fix typos of "Firewire", and of "controller" on same line Signed-off-by: Rebecca Cran Reviewed-by: Peter Maydell Message-Id: <20220318101124.912-1-quic_rcran@quicinc.com> Signed-off-by: Laurent Vivier --- hw/pci/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 5cb1232e27..dae9119bfe 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -1697,7 +1697,7 @@ static const pci_class_desc pci_class_descriptions[] = { 0x0902, "Mouse", "mouse"}, { 0x0A00, "Dock station", "dock", 0x00ff}, { 0x0B00, "i386 cpu", "cpu", 0x00ff}, - { 0x0c00, "Fireware contorller", "fireware"}, + { 0x0c00, "Firewire controller", "firewire"}, { 0x0c01, "Access bus controller", "access-bus"}, { 0x0c02, "SSA controller", "ssa"}, { 0x0c03, "USB controller", "usb"}, From a2d860bb546aa766f6c28a47fabedafbfa191cc2 Mon Sep 17 00:00:00 2001 From: Bernhard Beschow Date: Tue, 1 Mar 2022 23:23:01 +0100 Subject: [PATCH 2/2] virtio/virtio-balloon: Prefer Object* over void* parameter *opaque is an alias to *obj. Using the ladder makes the code consistent with with other devices, e.g. accel/kvm/kvm-all and accel/tcg/tcg-all. It also makes the cast more typesafe. Signed-off-by: Bernhard Beschow Reviewed-by: David Hildenbrand Acked-by: Michael S. Tsirkin Message-Id: <20220301222301.103821-2-shentey@gmail.com> Signed-off-by: Laurent Vivier --- hw/virtio/virtio-balloon.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c index e6c1b0aa46..163d244eb4 100644 --- a/hw/virtio/virtio-balloon.c +++ b/hw/virtio/virtio-balloon.c @@ -242,7 +242,7 @@ static void balloon_stats_get_all(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { Error *err = NULL; - VirtIOBalloon *s = opaque; + VirtIOBalloon *s = VIRTIO_BALLOON(obj); int i; if (!visit_start_struct(v, name, NULL, 0, &err)) { @@ -277,7 +277,7 @@ static void balloon_stats_get_poll_interval(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { - VirtIOBalloon *s = opaque; + VirtIOBalloon *s = VIRTIO_BALLOON(obj); visit_type_int(v, name, &s->stats_poll_interval, errp); } @@ -285,7 +285,7 @@ static void balloon_stats_set_poll_interval(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { - VirtIOBalloon *s = opaque; + VirtIOBalloon *s = VIRTIO_BALLOON(obj); int64_t value; if (!visit_type_int(v, name, &value, errp)) { @@ -1015,12 +1015,12 @@ static void virtio_balloon_instance_init(Object *obj) s->free_page_hint_notify.notify = virtio_balloon_free_page_hint_notify; object_property_add(obj, "guest-stats", "guest statistics", - balloon_stats_get_all, NULL, NULL, s); + balloon_stats_get_all, NULL, NULL, NULL); object_property_add(obj, "guest-stats-polling-interval", "int", balloon_stats_get_poll_interval, balloon_stats_set_poll_interval, - NULL, s); + NULL, NULL); } static const VMStateDescription vmstate_virtio_balloon = {