From: Michal Privoznik Date: Wed, 8 Mar 2023 07:57:35 +0000 (+0100) Subject: virscsihost: Drop needless labels X-Git-Tag: v9.2.0-rc1~134 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20a719dce6480e7369eab357326281b3437505b6;p=thirdparty%2Flibvirt.git 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 Reviewed-by: Ján Tomko --- diff --git a/src/util/virscsihost.c b/src/util/virscsihost.c index c816b21f64..014b96452c 100644 --- a/src/util/virscsihost.c +++ b/src/util/virscsihost.c @@ -95,7 +95,6 @@ virSCSIHostFindByPCI(const char *sysfs_prefix, const char *prefix = sysfs_prefix ? sysfs_prefix : SYSFS_SCSI_HOST_PATH; struct dirent *entry = NULL; g_autoptr(DIR) dir = NULL; - char *ret = NULL; if (virDirOpen(&dir, prefix) < 0) return NULL; @@ -114,7 +113,7 @@ virSCSIHostFindByPCI(const char *sysfs_prefix, host_link = g_strdup_printf("%s/%s", prefix, entry->d_name); if (virFileResolveLink(host_link, &host_path) < 0) - goto cleanup; + return NULL; if (!strstr(host_path, parentaddr)) { continue; @@ -127,24 +126,22 @@ virSCSIHostFindByPCI(const char *sysfs_prefix, } if (virFileReadAll(unique_path, 1024, &buf) < 0) - goto cleanup; + return NULL; if ((p = strchr(buf, '\n'))) *p = '\0'; if (virStrToLong_ui(buf, NULL, 10, &read_unique_id) < 0) - goto cleanup; + return NULL; if (read_unique_id != unique_id) { continue; } - ret = g_strdup(entry->d_name); - break; + return g_strdup(entry->d_name); } - cleanup: - return ret; + return NULL; } @@ -224,10 +221,9 @@ virSCSIHostGetNameByParentaddr(unsigned int domain, _("Failed to find scsi_host using PCI '%s' " "and unique_id='%u'"), parentaddr, unique_id); - goto cleanup; + return NULL; } - cleanup: return name; }