]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
node_device: remove unneeded labels
authorDaniel Henrique Barboza <danielhb413@gmail.com>
Mon, 6 Jan 2020 21:57:37 +0000 (18:57 -0300)
committerErik Skultety <eskultet@redhat.com>
Tue, 7 Jan 2020 15:40:41 +0000 (16:40 +0100)
gather_scsi_host_cap() in node_device_hal.c can be greatly
simplified, given that the 'out' label is always getting
hit regardless of 'retval', which can also be eliminated.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
src/node_device/node_device_driver.c
src/node_device/node_device_hal.c

index ebcc9696af4380633145749b865cd0ca53e934fd..b630be4399123e9a679506e41ca70484eede9858 100644 (file)
@@ -572,13 +572,13 @@ nodeConnectNodeDeviceEventRegisterAny(virConnectPtr conn,
     int callbackID = -1;
 
     if (virConnectNodeDeviceEventRegisterAnyEnsureACL(conn) < 0)
-        goto cleanup;
+        return -1;
 
     if (virNodeDeviceEventStateRegisterID(conn, driver->nodeDeviceEventState,
                                           device, eventID, callback,
                                           opaque, freecb, &callbackID) < 0)
         callbackID = -1;
- cleanup:
+
     return callbackID;
 }
 
index cf12854fe9d9986a4a9895520658159dd2e10fda..4cef7c2c1242cd5b272346fdf644f9de267e4a1a 100644 (file)
@@ -232,17 +232,9 @@ static int
 gather_scsi_host_cap(LibHalContext *ctx, const char *udi,
                      virNodeDevCapDataPtr d)
 {
-    int retval = 0;
-
     (void)get_int_prop(ctx, udi, "scsi_host.host", (int *)&d->scsi_host.host);
 
-    retval = virNodeDeviceGetSCSIHostCaps(&d->scsi_host);
-
-    if (retval == -1)
-        goto out;
-
- out:
-    return retval;
+    return virNodeDeviceGetSCSIHostCaps(&d->scsi_host);
 }