From 815db3ea58e4c1d270f1fa5cf2664f0745893d21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Wed, 13 Nov 2019 13:09:11 +0100 Subject: [PATCH] libxl: remove 'ret' from xenParseSxprVifRate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that the cleanup section is empty, the ret variable is no longer necessary. Signed-off-by: Ján Tomko Reviewed-by: Peter Krempa --- src/libxl/xen_common.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/libxl/xen_common.c b/src/libxl/xen_common.c index 7dd06b67c3..b6c96799d9 100644 --- a/src/libxl/xen_common.c +++ b/src/libxl/xen_common.c @@ -1067,7 +1067,6 @@ xenParseSxprVifRate(const char *rate, unsigned long long *kbytes_per_sec) char *p; char *suffix; unsigned long long tmp; - int ret = -1; trate = g_strdup(rate); @@ -1085,13 +1084,13 @@ xenParseSxprVifRate(const char *rate, unsigned long long *kbytes_per_sec) if (!g_regex_match(regex, trate, 0, NULL)) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Invalid rate '%s' specified"), rate); - goto cleanup; + return -1; } if (virStrToLong_ull(rate, &suffix, 10, &tmp)) { virReportError(VIR_ERR_INTERNAL_ERROR, _("Failed to parse rate '%s'"), rate); - goto cleanup; + return -1; } if (*suffix == 'G') @@ -1103,10 +1102,7 @@ xenParseSxprVifRate(const char *rate, unsigned long long *kbytes_per_sec) tmp /= 8; *kbytes_per_sec = tmp; - ret = 0; - - cleanup: - return ret; + return 0; } -- GitLab