[PATCH 01/21] virDomainPCIAddressSetExtensionAlloc: Remove return value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The function always returns 0. Remove the return value and refactor
caller.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/conf/domain_addr.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c
index b6534f502c..cf30ad297c 100644
--- a/src/conf/domain_addr.c
+++ b/src/conf/domain_addr.c
@@ -974,21 +974,19 @@ virDomainPCIAddressSetExtensionFree(virDomainZPCIAddressIds *zpciIds)
 }


-static int
+static void
 virDomainPCIAddressSetExtensionAlloc(virDomainPCIAddressSet *addrs,
                                      virPCIDeviceAddressExtensionFlags extFlags)
 {
     if (extFlags & VIR_PCI_ADDRESS_EXTENSION_ZPCI) {
         if (addrs->zpciIds)
-            return 0;
+            return;

         addrs->zpciIds = g_new0(virDomainZPCIAddressIds, 1);

         addrs->zpciIds->uids = g_hash_table_new_full(g_int_hash, g_int_equal, g_free, NULL);
         addrs->zpciIds->fids = g_hash_table_new_full(g_int_hash, g_int_equal, g_free, NULL);
     }
-
-    return 0;
 }


@@ -1002,14 +1000,9 @@ virDomainPCIAddressSetAlloc(unsigned int nbuses,
     addrs->buses = g_new0(virDomainPCIAddressBus, nbuses);
     addrs->nbuses = nbuses;

-    if (virDomainPCIAddressSetExtensionAlloc(addrs, extFlags) < 0)
-        goto error;
+    virDomainPCIAddressSetExtensionAlloc(addrs, extFlags);

     return addrs;
-
- error:
-    virDomainPCIAddressSetFree(addrs);
-    return NULL;
 }


-- 
2.39.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux