提交 fe65e9c8 编写于 作者: M Michal Privoznik

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: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 ce87e7f2
...@@ -720,7 +720,6 @@ virLockDaemonPreExecRestart(const char *state_file, ...@@ -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, ...@@ -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, ...@@ -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, ...@@ -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, ...@@ -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) ...@@ -254,7 +253,7 @@ virStorageBackendMpathRefreshPool(virStoragePoolObjPtr pool)
virStorageBackendGetMaps(pool); virStorageBackendGetMaps(pool);
return retval; return 0;
} }
......
...@@ -47,7 +47,6 @@ ...@@ -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) ...@@ -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;
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册