From: Daniel Henrique Barboza Date: Mon, 6 Jan 2020 21:57:37 +0000 (-0300) Subject: node_device: remove unneeded labels X-Git-Tag: v6.0.0-rc1~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c57d01479d500555cd1a26a755b4d93e0b4b4fe3;p=thirdparty%2Flibvirt.git node_device: remove unneeded labels 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 Reviewed-by: Erik Skultety --- diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c index ebcc9696af..b630be4399 100644 --- a/src/node_device/node_device_driver.c +++ b/src/node_device/node_device_driver.c @@ -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; } diff --git a/src/node_device/node_device_hal.c b/src/node_device/node_device_hal.c index cf12854fe9..4cef7c2c12 100644 --- a/src/node_device/node_device_hal.c +++ b/src/node_device/node_device_hal.c @@ -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); }