Now that the cleanup section is empty, the ret variable is no longer
necessary.
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
char *p;
char *suffix;
unsigned long long tmp;
- int ret = -1;
trate = g_strdup(rate);
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')
tmp /= 8;
*kbytes_per_sec = tmp;
- ret = 0;
-
- cleanup:
- return ret;
+ return 0;
}