From: Marc Hartmayer Date: Tue, 23 Apr 2024 18:08:56 +0000 (+0200) Subject: node_device_udev: Inline `udevRemoveOneDevice` X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=d7c8908be8bbacc106f196062361ba0a3764bcb0;p=libvirt.git node_device_udev: Inline `udevRemoveOneDevice` Inline `udevRemoveOneDevice` as it's used only once. Reviewed-by: Boris Fiuczynski Reviewed-by: Jonathon Jongsma Signed-off-by: Marc Hartmayer --- diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c index 566743e510..f3cf124bdd 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -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");