mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-07-31 22:17:17 +00:00
virscsihost: Drop needless labels
After previous cleanups, we're left with a couple of needless labels, that contain nothing but a return statement. Drop those. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
ade974d3ae
commit
20a719dce6
@ -95,7 +95,6 @@ virSCSIHostFindByPCI(const char *sysfs_prefix,
|
|||||||
const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SCSI_HOST_PATH;
|
const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SCSI_HOST_PATH;
|
||||||
struct dirent *entry = NULL;
|
struct dirent *entry = NULL;
|
||||||
g_autoptr(DIR) dir = NULL;
|
g_autoptr(DIR) dir = NULL;
|
||||||
char *ret = NULL;
|
|
||||||
|
|
||||||
if (virDirOpen(&dir, prefix) < 0)
|
if (virDirOpen(&dir, prefix) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -114,7 +113,7 @@ virSCSIHostFindByPCI(const char *sysfs_prefix,
|
|||||||
host_link = g_strdup_printf("%s/%s", prefix, entry->d_name);
|
host_link = g_strdup_printf("%s/%s", prefix, entry->d_name);
|
||||||
|
|
||||||
if (virFileResolveLink(host_link, &host_path) < 0)
|
if (virFileResolveLink(host_link, &host_path) < 0)
|
||||||
goto cleanup;
|
return NULL;
|
||||||
|
|
||||||
if (!strstr(host_path, parentaddr)) {
|
if (!strstr(host_path, parentaddr)) {
|
||||||
continue;
|
continue;
|
||||||
@ -127,24 +126,22 @@ virSCSIHostFindByPCI(const char *sysfs_prefix,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (virFileReadAll(unique_path, 1024, &buf) < 0)
|
if (virFileReadAll(unique_path, 1024, &buf) < 0)
|
||||||
goto cleanup;
|
return NULL;
|
||||||
|
|
||||||
if ((p = strchr(buf, '\n')))
|
if ((p = strchr(buf, '\n')))
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
|
|
||||||
if (virStrToLong_ui(buf, NULL, 10, &read_unique_id) < 0)
|
if (virStrToLong_ui(buf, NULL, 10, &read_unique_id) < 0)
|
||||||
goto cleanup;
|
return NULL;
|
||||||
|
|
||||||
if (read_unique_id != unique_id) {
|
if (read_unique_id != unique_id) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = g_strdup(entry->d_name);
|
return g_strdup(entry->d_name);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
return NULL;
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -224,10 +221,9 @@ virSCSIHostGetNameByParentaddr(unsigned int domain,
|
|||||||
_("Failed to find scsi_host using PCI '%s' "
|
_("Failed to find scsi_host using PCI '%s' "
|
||||||
"and unique_id='%u'"),
|
"and unique_id='%u'"),
|
||||||
parentaddr, unique_id);
|
parentaddr, unique_id);
|
||||||
goto cleanup;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup:
|
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user