diff mbox series

[RFC,PATCH-for-5.2,5/5] hw/virtio: Simplify virtio_mem_set_requested_size()

Message ID 20200715175835.27744-6-philmd@redhat.com
State New
Headers show
Series [PATCH-for-5.2,1/5] hw/core/qdev-properties: Simplify get_reserved_region() | expand

Commit Message

Philippe Mathieu-Daudé July 15, 2020, 5:58 p.m. UTC
Simplify by directly using visit_type_size() return value.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/virtio/virtio-mem.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c
index ddf09ed1bf..e407abc2d8 100644
--- a/hw/virtio/virtio-mem.c
+++ b/hw/virtio/virtio-mem.c
@@ -687,12 +687,9 @@  static void virtio_mem_set_requested_size(Object *obj, Visitor *v,
                                           Error **errp)
 {
     VirtIOMEM *vmem = VIRTIO_MEM(obj);
-    Error *err = NULL;
     uint64_t value;
 
-    visit_type_size(v, name, &value, &err);
-    if (err) {
-        error_propagate(errp, err);
+    if (!visit_type_size(v, name, &value, errp)) {
         return;
     }