summary refs log tree commit diff stats
path: root/hw/vfio/platform.c
diff options
context:
space:
mode:
authorZhenzhong Duan <zhenzhong.duan@intel.com>2024-05-22 12:40:00 +0800
committerCédric Le Goater <clg@redhat.com>2024-05-22 10:04:21 +0200
commitc6c6cf91c0ad2a98d2566de162c3e089b75c2fc4 (patch)
treef81c5a1b6b8272c1df14fcfac01b0a6c4dac9141 /hw/vfio/platform.c
parent84e37d02969ca1c7a6a8670e7d1da8e4ca5d56b9 (diff)
downloadfocaccia-qemu-c6c6cf91c0ad2a98d2566de162c3e089b75c2fc4.tar.gz
focaccia-qemu-c6c6cf91c0ad2a98d2566de162c3e089b75c2fc4.zip
vfio/helpers: Make vfio_device_get_name() return bool
This is to follow the coding standand in qapi/error.h to return bool
for bool-valued functions.

Suggested-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
Diffstat (limited to 'hw/vfio/platform.c')
-rw-r--r--hw/vfio/platform.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c
index 3233ca8691..e1a32863d9 100644
--- a/hw/vfio/platform.c
+++ b/hw/vfio/platform.c
@@ -545,9 +545,8 @@ static int vfio_base_device_init(VFIODevice *vbasedev, Error **errp)
                                              vbasedev->name);
     }
 
-    ret = vfio_device_get_name(vbasedev, errp);
-    if (ret) {
-        return ret;
+    if (!vfio_device_get_name(vbasedev, errp)) {
+        return -EINVAL;
     }
 
     if (!vfio_attach_device(vbasedev->name, vbasedev,