]> xenbits.xensource.com Git - libvirt.git/commitdiff
node_device_udev: Inline `udevRemoveOneDevice`
authorMarc Hartmayer <mhartmay@linux.ibm.com>
Tue, 23 Apr 2024 18:08:56 +0000 (20:08 +0200)
committerJonathon Jongsma <jjongsma@redhat.com>
Tue, 18 Jun 2024 14:00:23 +0000 (09:00 -0500)
Inline `udevRemoveOneDevice` as it's used only once.

Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
src/node_device/node_device_udev.c

index 566743e510c9a1194e2ac2c18ab639af9422a5f3..f3cf124bdd898a25f1c0dba8e974529a5d52a4e1 100644 (file)
@@ -1485,16 +1485,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)
@@ -1778,8 +1768,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");