mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 18:03:32 +00:00
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 <danielhb413@gmail.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
dbc39858bd
commit
c57d01479d
@ -572,13 +572,13 @@ nodeConnectNodeDeviceEventRegisterAny(virConnectPtr conn,
|
|||||||
int callbackID = -1;
|
int callbackID = -1;
|
||||||
|
|
||||||
if (virConnectNodeDeviceEventRegisterAnyEnsureACL(conn) < 0)
|
if (virConnectNodeDeviceEventRegisterAnyEnsureACL(conn) < 0)
|
||||||
goto cleanup;
|
return -1;
|
||||||
|
|
||||||
if (virNodeDeviceEventStateRegisterID(conn, driver->nodeDeviceEventState,
|
if (virNodeDeviceEventStateRegisterID(conn, driver->nodeDeviceEventState,
|
||||||
device, eventID, callback,
|
device, eventID, callback,
|
||||||
opaque, freecb, &callbackID) < 0)
|
opaque, freecb, &callbackID) < 0)
|
||||||
callbackID = -1;
|
callbackID = -1;
|
||||||
cleanup:
|
|
||||||
return callbackID;
|
return callbackID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,17 +232,9 @@ static int
|
|||||||
gather_scsi_host_cap(LibHalContext *ctx, const char *udi,
|
gather_scsi_host_cap(LibHalContext *ctx, const char *udi,
|
||||||
virNodeDevCapDataPtr d)
|
virNodeDevCapDataPtr d)
|
||||||
{
|
{
|
||||||
int retval = 0;
|
|
||||||
|
|
||||||
(void)get_int_prop(ctx, udi, "scsi_host.host", (int *)&d->scsi_host.host);
|
(void)get_int_prop(ctx, udi, "scsi_host.host", (int *)&d->scsi_host.host);
|
||||||
|
|
||||||
retval = virNodeDeviceGetSCSIHostCaps(&d->scsi_host);
|
return virNodeDeviceGetSCSIHostCaps(&d->scsi_host);
|
||||||
|
|
||||||
if (retval == -1)
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
out:
|
|
||||||
return retval;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user