[PATCH] change return type of virURIParamAppend() to void type

Ani Sinha posted 1 patch 2 years, 3 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20220106170755.185764-1-ani@anisinha.ca
src/util/viruri.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
[PATCH] change return type of virURIParamAppend() to void type
Posted by Ani Sinha 2 years, 3 months ago
virURIParamAppend() unconditionally returns 0. Simplify and make the return type
as void type.

Signed-off-by: Ani Sinha <ani@anisinha.ca>
---
 src/util/viruri.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/util/viruri.c b/src/util/viruri.c
index 3c73188a55..88bb0cc1f8 100644
--- a/src/util/viruri.c
+++ b/src/util/viruri.c
@@ -34,7 +34,7 @@
 
 VIR_LOG_INIT("util.uri");
 
-static int
+static void
 virURIParamAppend(virURI *uri,
                   const char *name,
                   const char *value)
@@ -52,7 +52,7 @@ virURIParamAppend(virURI *uri,
     uri->params[uri->paramsCount].ignore = false;
     uri->paramsCount++;
 
-    return 0;
+    return;
 }
 
 
@@ -113,8 +113,7 @@ virURIParseParams(virURI *uri)
         }
 
         /* Append to the parameter set. */
-        if (virURIParamAppend(uri, name, NULLSTR_EMPTY(value)) < 0)
-            return -1;
+        virURIParamAppend(uri, name, NULLSTR_EMPTY(value));
 
     next:
         query = end;
-- 
2.25.1

Re: [PATCH] change return type of virURIParamAppend() to void type
Posted by Ján Tomko 2 years, 3 months ago
On a Thursday in 2022, Ani Sinha wrote:
>virURIParamAppend() unconditionally returns 0. Simplify and make the return type
>as void type.
>
>Signed-off-by: Ani Sinha <ani@anisinha.ca>
>---
> src/util/viruri.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>
and pushed

Jano