]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
chExtractVersionInfo: Don't check for retversion != NULL
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 4 Jun 2021 12:19:15 +0000 (14:19 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 4 Jun 2021 14:39:00 +0000 (16:39 +0200)
The only caller, chExtractVersion() passes not NULL. Therefore,
it's redundant to check for NULL.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/ch/ch_conf.c

index d900ebc7dd977ac6ab5810aa65815ebb92776ef2..706e5f0ba4ae644a814f8305e4e4972b437abe17 100644 (file)
@@ -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: