]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: Improve error handling in virDomainChrDefFormat()
authorAndrea Bolognani <abologna@redhat.com>
Mon, 20 Nov 2017 17:07:20 +0000 (18:07 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Tue, 28 Nov 2017 14:46:32 +0000 (15:46 +0100)
We don't need to store the return value since we never modify it.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
src/conf/domain_conf.c

index c0e239defb5b97a898ec871e245446dc5092ff37..cb98631fbcb35f8bb8d5b1d05e7047b6e1f18610 100644 (file)
@@ -24037,8 +24037,6 @@ virDomainChrDefFormat(virBufferPtr buf,
     const char *elementName = virDomainChrDeviceTypeToString(def->deviceType);
     bool tty_compat;
 
-    int ret = 0;
-
     if (!elementName) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("unexpected char device type %d"),
@@ -24059,14 +24057,14 @@ virDomainChrDefFormat(virBufferPtr buf,
     virDomainChrSourceDefFormat(buf, def->source, flags);
 
     if (virDomainChrTargetDefFormat(buf, def, flags) < 0)
-       return -1;
+        return -1;
 
     virDomainDeviceInfoFormat(buf, &def->info, flags);
 
     virBufferAdjustIndent(buf, -2);
     virBufferAsprintf(buf, "</%s>\n", elementName);
 
-    return ret;
+    return 0;
 }
 
 static int