[PATCH 2/6] chExtractVersionInfo: Don't check for retversion != NULL

Michal Privoznik posted 6 patches 4 years, 8 months ago
[PATCH 2/6] chExtractVersionInfo: Don't check for retversion != NULL
Posted by Michal Privoznik 4 years, 8 months ago
The only caller, chExtractVersion() passes not NULL. Therefore,
it's redundant to check for NULL.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 src/ch/ch_conf.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/ch/ch_conf.c b/src/ch/ch_conf.c
index d900ebc7dd..706e5f0ba4 100644
--- a/src/ch/ch_conf.c
+++ b/src/ch/ch_conf.c
@@ -201,8 +201,7 @@ chExtractVersionInfo(int *retversion)
     g_autofree char *ch_cmd = g_find_program_in_path(CH_CMD);
     virCommand *cmd = virCommandNewArgList(ch_cmd, "--version", NULL);
 
-    if (retversion)
-        *retversion = 0;
+    *retversion = 0;
 
     virCommandAddEnvString(cmd, "LC_ALL=C");
     virCommandSetOutputBuffer(cmd, &help);
@@ -231,9 +230,7 @@ chExtractVersionInfo(int *retversion)
         goto cleanup;
     }
 
-    if (retversion)
-        *retversion = version;
-
+    *retversion = version;
     ret = 0;
 
  cleanup:
-- 
2.31.1