[PATCH v3 7/7] virdnsmasq: Join dnsmasqCapsNewEmpty() and dnsmasqCapsNewFromBinary()

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

 



After previous cleanups, there's just one caller of
dnsmasqCapsNewEmpty() and it is dnsmasqCapsNewFromBinary().
And the former is pretty short. Therefore, it is not necessary
for the code to live in two separate functions. Dissolve the
former in the latter.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/util/virdnsmasq.c | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/src/util/virdnsmasq.c b/src/util/virdnsmasq.c
index ca52bf7871..4108fc262b 100644
--- a/src/util/virdnsmasq.c
+++ b/src/util/virdnsmasq.c
@@ -689,13 +689,14 @@ dnsmasqCapsRefreshInternal(dnsmasqCaps *caps, bool force)
     return dnsmasqCapsSetFromBuffer(caps, complete);
 }
 
-static dnsmasqCaps *
-dnsmasqCapsNewEmpty(void)
+dnsmasqCaps *
+dnsmasqCapsNewFromBinary(void)
 {
     g_autoptr(dnsmasqCaps) caps = NULL;
 
     if (dnsmasqCapsInitialize() < 0)
         return NULL;
+
     if (!(caps = virObjectNew(dnsmasqCapsClass)))
         return NULL;
 
@@ -705,17 +706,6 @@ dnsmasqCapsNewEmpty(void)
         return NULL;
     }
 
-    return g_steal_pointer(&caps);
-}
-
-dnsmasqCaps *
-dnsmasqCapsNewFromBinary(void)
-{
-    g_autoptr(dnsmasqCaps) caps = dnsmasqCapsNewEmpty();
-
-    if (!caps)
-        return NULL;
-
     if (dnsmasqCapsRefreshInternal(caps, true) < 0)
         return NULL;
 
-- 
2.34.1




[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