[PATCH 06/43] virNodeDevCapsDefParseULong: Use virXPathUInt instead of virXPathULong

Peter Krempa posted 43 patches 3 years, 3 months ago
[PATCH 06/43] virNodeDevCapsDefParseULong: Use virXPathUInt instead of virXPathULong
Posted by Peter Krempa 3 years, 3 months ago
Fix the function argument to properly spell out 'unsigned int' and use
virXPathUInt instead of virXPathULong and a temporary value.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/conf/node_device_conf.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
index bdfbbab434..bb10b9dabe 100644
--- a/src/conf/node_device_conf.c
+++ b/src/conf/node_device_conf.c
@@ -833,15 +833,14 @@ virNodeDevCapsDefParseIntOptional(const char *xpath,
 static int
 virNodeDevCapsDefParseULong(const char *xpath,
                             xmlXPathContextPtr ctxt,
-                            unsigned *value,
+                            unsigned int *value,
                             virNodeDeviceDef *def,
                             const char *missing_error_fmt,
                             const char *invalid_error_fmt)
 {
     int ret;
-    unsigned long val;

-    ret = virXPathULong(xpath, ctxt, &val);
+    ret = virXPathUInt(xpath, ctxt, value);
     if (ret < 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        ret == -1 ? missing_error_fmt : invalid_error_fmt,
@@ -849,7 +848,6 @@ virNodeDevCapsDefParseULong(const char *xpath,
         return -1;
     }

-    *value = val;
     return 0;
 }

-- 
2.37.3
Re: [PATCH 06/43] virNodeDevCapsDefParseULong: Use virXPathUInt instead of virXPathULong
Posted by Ján Tomko 3 years, 3 months ago
On a Monday in 2022, Peter Krempa wrote:
>Fix the function argument to properly spell out 'unsigned int' and use
>virXPathUInt instead of virXPathULong and a temporary value.
>
>Signed-off-by: Peter Krempa <pkrempa@redhat.com>
>---
> src/conf/node_device_conf.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>

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

Jano