Blob Blame History Raw
From c671c037d06c761708374dba1b7e4ed4041fe9fb Mon Sep 17 00:00:00 2001
Message-Id: <c671c037d06c761708374dba1b7e4ed4041fe9fb@dist-git>
From: Peter Krempa <pkrempa@redhat.com>
Date: Fri, 20 Mar 2020 10:28:51 +0100
Subject: [PATCH] virSecretLookupDefCopy: Remove return value
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

The function always returns succes so there's no need for a return
value.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 02f909b8a6ad8c271693fed9ceab606f0dda2294)

https://bugzilla.redhat.com/show_bug.cgi?id=1814923
Message-Id: <a2f47ac4171ea9eaf3fbee12f22670ff10a1b98c.1584696274.git.pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
 src/util/virsecret.c      | 3 +--
 src/util/virsecret.h      | 4 ++--
 src/util/virstoragefile.c | 3 +--
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/util/virsecret.c b/src/util/virsecret.c
index 174ce544c0..167ad24fdf 100644
--- a/src/util/virsecret.c
+++ b/src/util/virsecret.c
@@ -47,7 +47,7 @@ virSecretLookupDefClear(virSecretLookupTypeDefPtr def)
 }
 
 
-int
+void
 virSecretLookupDefCopy(virSecretLookupTypeDefPtr dst,
                        const virSecretLookupTypeDef *src)
 {
@@ -57,7 +57,6 @@ virSecretLookupDefCopy(virSecretLookupTypeDefPtr dst,
     } else if (dst->type == VIR_SECRET_LOOKUP_TYPE_USAGE) {
         dst->u.usage = g_strdup(src->u.usage);
     }
-    return 0;
 }
 
 
diff --git a/src/util/virsecret.h b/src/util/virsecret.h
index 8bc8a24e0f..780b5761f4 100644
--- a/src/util/virsecret.h
+++ b/src/util/virsecret.h
@@ -49,8 +49,8 @@ struct _virSecretLookupTypeDef {
 };
 
 void virSecretLookupDefClear(virSecretLookupTypeDefPtr def);
-int virSecretLookupDefCopy(virSecretLookupTypeDefPtr dst,
-                           const virSecretLookupTypeDef *src);
+void virSecretLookupDefCopy(virSecretLookupTypeDefPtr dst,
+                            const virSecretLookupTypeDef *src);
 int virSecretLookupParseSecret(xmlNodePtr secretnode,
                                virSecretLookupTypeDefPtr def);
 void virSecretLookupFormatSecret(virBufferPtr buf,
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index ce126f5cba..fa37840532 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -1792,8 +1792,7 @@ virStorageAuthDefCopy(const virStorageAuthDef *src)
     authdef->secrettype = g_strdup(src->secrettype);
     authdef->authType = src->authType;
 
-    if (virSecretLookupDefCopy(&authdef->seclookupdef, &src->seclookupdef) < 0)
-        return NULL;
+    virSecretLookupDefCopy(&authdef->seclookupdef, &src->seclookupdef);
 
     return g_steal_pointer(&authdef);
 }
-- 
2.25.1