]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: remove unnecessary NULL checks
authorJonathon Jongsma <jjongsma@redhat.com>
Wed, 23 Oct 2019 17:46:46 +0000 (12:46 -0500)
committerCole Robinson <crobinso@redhat.com>
Wed, 13 Nov 2019 18:10:46 +0000 (13:10 -0500)
Just above in the function, we return from the function if either x or y
are NULL, so there's no need to re-check whether x or y are NULL.

Reviewed-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
src/conf/domain_conf.c

index 149a0474460450d7d5ab6b0d4c666191cab026b6..921780f72b550d04561f8d6146487c914f7aa5ea 100644 (file)
@@ -15333,20 +15333,16 @@ virDomainVideoResolutionDefParseXML(xmlNodePtr node)
     if (VIR_ALLOC(def) < 0)
         goto cleanup;
 
-    if (x) {
-        if (virStrToLong_uip(x, NULL, 10, &def->x) < 0) {
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                           _("cannot parse video x-resolution '%s'"), x);
-            goto cleanup;
-        }
+    if (virStrToLong_uip(x, NULL, 10, &def->x) < 0) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                       _("cannot parse video x-resolution '%s'"), x);
+        goto cleanup;
     }
 
-    if (y) {
-        if (virStrToLong_uip(y, NULL, 10, &def->y) < 0) {
-            virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
-                           _("cannot parse video y-resolution '%s'"), y);
-            goto cleanup;
-        }
+    if (virStrToLong_uip(y, NULL, 10, &def->y) < 0) {
+        virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                       _("cannot parse video y-resolution '%s'"), y);
+        goto cleanup;
     }
 
  cleanup: