Re: [RFC PATCH v1 10/15] node_device_udev: Inline `udevRemoveOneDevice`

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

 



Reviewed-by: Boris Fiuczynski <fiuczy@xxxxxxxxxxxxx>

On 4/12/24 15:36, Marc Hartmayer wrote:
Inline `udevRemoveOneDevice` as it's used only once.

Signed-off-by: Marc Hartmayer <mhartmay@xxxxxxxxxxxxx>
---
  src/node_device/node_device_udev.c | 17 +++++------------
  1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index a121ad99a676..672da8f5a19f 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -1490,16 +1490,6 @@ udevRemoveOneDeviceSysPath(const char *path)
      return 0;
  }
-
-static int
-udevRemoveOneDevice(struct udev_device *device)
-{
-    const char *path = udev_device_get_syspath(device);
-
-    return udevRemoveOneDeviceSysPath(path);
-}
-
-
  static int
  udevSetParent(struct udev_device *device,
                virNodeDeviceDef *def)
@@ -1788,8 +1778,11 @@ udevHandleOneDevice(struct udev_device *device)
      if (STREQ(action, "add") || STREQ(action, "change"))
          return udevAddOneDevice(device);
- if (STREQ(action, "remove"))
-        return udevRemoveOneDevice(device);
+    if (STREQ(action, "remove")) {
+        const char *path = udev_device_get_syspath(device);
+
+        return udevRemoveOneDeviceSysPath(path);
+    }
if (STREQ(action, "move")) {
          const char *devpath_old = udevGetDeviceProperty(device, "DEVPATH_OLD");

--
Mit freundlichen Grüßen/Kind regards
   Boris Fiuczynski

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Wolfgang Wendt
Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294
_______________________________________________
Devel mailing list -- devel@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx




[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