mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
lib: Drop needless ret variables
There are few places where a return variable is introduced (ret or retval), but then is never changed and is then passed to return. Well, we can return the value that the variable is initialized to directly. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
ce87e7f2a6
commit
fe65e9c8b5
@ -720,7 +720,6 @@ virLockDaemonPreExecRestart(const char *state_file,
|
|||||||
{
|
{
|
||||||
virJSONValuePtr child;
|
virJSONValuePtr child;
|
||||||
char *state = NULL;
|
char *state = NULL;
|
||||||
int ret = -1;
|
|
||||||
virJSONValuePtr object = virJSONValueNewObject();
|
virJSONValuePtr object = virJSONValueNewObject();
|
||||||
char *magic;
|
char *magic;
|
||||||
virHashKeyValuePairPtr pairs = NULL, tmp;
|
virHashKeyValuePairPtr pairs = NULL, tmp;
|
||||||
@ -800,7 +799,7 @@ virLockDaemonPreExecRestart(const char *state_file,
|
|||||||
VIR_FREE(pairs);
|
VIR_FREE(pairs);
|
||||||
VIR_FREE(state);
|
VIR_FREE(state);
|
||||||
virJSONValueFree(object);
|
virJSONValueFree(object);
|
||||||
return ret;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -524,7 +524,6 @@ virLogDaemonPreExecRestart(const char *state_file,
|
|||||||
{
|
{
|
||||||
virJSONValuePtr child;
|
virJSONValuePtr child;
|
||||||
char *state = NULL;
|
char *state = NULL;
|
||||||
int ret = -1;
|
|
||||||
virJSONValuePtr object = virJSONValueNewObject();
|
virJSONValuePtr object = virJSONValueNewObject();
|
||||||
char *magic;
|
char *magic;
|
||||||
virHashKeyValuePairPtr pairs = NULL;
|
virHashKeyValuePairPtr pairs = NULL;
|
||||||
@ -581,7 +580,7 @@ virLogDaemonPreExecRestart(const char *state_file,
|
|||||||
VIR_FREE(pairs);
|
VIR_FREE(pairs);
|
||||||
VIR_FREE(state);
|
VIR_FREE(state);
|
||||||
virJSONValueFree(object);
|
virJSONValueFree(object);
|
||||||
return ret;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -243,7 +243,6 @@ virStorageBackendMpathCheckPool(virStoragePoolObjPtr pool G_GNUC_UNUSED,
|
|||||||
static int
|
static int
|
||||||
virStorageBackendMpathRefreshPool(virStoragePoolObjPtr pool)
|
virStorageBackendMpathRefreshPool(virStoragePoolObjPtr pool)
|
||||||
{
|
{
|
||||||
int retval = 0;
|
|
||||||
virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
|
virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool);
|
||||||
|
|
||||||
VIR_DEBUG("pool=%p", pool);
|
VIR_DEBUG("pool=%p", pool);
|
||||||
@ -254,7 +253,7 @@ virStorageBackendMpathRefreshPool(virStoragePoolObjPtr pool)
|
|||||||
|
|
||||||
virStorageBackendGetMaps(pool);
|
virStorageBackendGetMaps(pool);
|
||||||
|
|
||||||
return retval;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -47,7 +47,6 @@
|
|||||||
|
|
||||||
int virHostValidateBhyve(void)
|
int virHostValidateBhyve(void)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
|
||||||
int fileid = 0;
|
int fileid = 0;
|
||||||
struct kld_file_stat stat;
|
struct kld_file_stat stat;
|
||||||
bool vmm_loaded = false, if_tap_loaded = false;
|
bool vmm_loaded = false, if_tap_loaded = false;
|
||||||
@ -73,5 +72,5 @@ int virHostValidateBhyve(void)
|
|||||||
MODULE_STATUS_WARN(if_bridge, "bridged networking will not work");
|
MODULE_STATUS_WARN(if_bridge, "bridged networking will not work");
|
||||||
MODULE_STATUS_WARN(nmdm, "nmdm console will not work");
|
MODULE_STATUS_WARN(nmdm, "nmdm console will not work");
|
||||||
|
|
||||||
return ret;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user