[PATCH 10/32] Remove udevStrToLong_ull

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

 



The wrapper adds an error message or a debug log.

Since we already log the properties we get from udev as strings,
there is no much use for the debug logs.

Open code the error message and delete the function.
---
 src/node_device/node_device_udev.c | 21 +++------------------
 1 file changed, 3 insertions(+), 18 deletions(-)

diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 2e2ed96..ff9668c 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -57,23 +57,6 @@ struct _udevPrivate {
     bool privileged;
 };
 
-static int udevStrToLong_ull(char const *s,
-                             char **end_ptr,
-                             int base,
-                             unsigned long long *result)
-{
-    int ret = 0;
-
-    ret = virStrToLong_ull(s, end_ptr, base, result);
-    if (ret != 0) {
-        VIR_ERROR(_("Failed to convert '%s' to unsigned long long"), s);
-    } else {
-        VIR_DEBUG("Converted '%s' to unsigned long %llu", s, *result);
-    }
-
-    return ret;
-}
-
 
 static int udevStrToLong_ui(char const *s,
                             char **end_ptr,
@@ -300,8 +283,10 @@ static int udevGetUint64SysfsAttr(struct udev_device *udev_device,
     ret = udevGetDeviceSysfsAttr(udev_device, attr_name, &udev_value);
 
     if (ret == PROPERTY_FOUND) {
-        if (udevStrToLong_ull(udev_value, NULL, 0, value) != 0)
+        if (virStrToLong_ull(udev_value, NULL, 0, value) < 0) {
+            VIR_ERROR(_("Failed to convert '%s' to unsigned long long"), udev_value);
             ret = PROPERTY_ERROR;
+        }
     }
 
     VIR_FREE(udev_value);
-- 
2.7.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[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]