Inline `udevRemoveOneDevice` as it's used only once.
Reviewed-by: Boris Fiuczynski <fiuczy(a)linux.ibm.com>
Reviewed-by: Jonathon Jongsma <jjongsma(a)redhat.com>
Signed-off-by: Marc Hartmayer <mhartmay(a)linux.ibm.com>
---
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 616ceca0b5c0..1c8832ebd990 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -1489,16 +1489,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");
--
2.34.1