From b1ba0ce80069760c27ef37fbcc16386c3b7c4031 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Sat, 7 May 2022 14:19:40 +0200 Subject: [PATCH] core/device: Use DEVICE_NOT_FOUND instead of 0. Use the enum name instead of the value zero. This is a noop change as DEVICE_NOT_FOUND == 0. --- src/core/device.c | 6 +++--- src/core/mount.c | 2 +- src/core/swap.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/device.c b/src/core/device.c index dd1f71d43c..f65dbfcb1e 100644 --- a/src/core/device.c +++ b/src/core/device.c @@ -885,7 +885,7 @@ static void device_remove_old_on_move(Manager *m, sd_device *dev) { if (!syspath_old) return (void) log_oom(); - device_update_found_by_sysfs(m, syspath_old, 0, DEVICE_FOUND_MASK); + device_update_found_by_sysfs(m, syspath_old, DEVICE_NOT_FOUND, DEVICE_FOUND_MASK); } static int device_dispatch_io(sd_device_monitor *monitor, sd_device *dev, void *userdata) { @@ -924,7 +924,7 @@ static int device_dispatch_io(sd_device_monitor *monitor, sd_device *dev, void * /* If we get notified that a device was removed by udev, then it's completely gone, hence * unset all found bits */ - device_update_found_by_sysfs(m, sysfs, 0, DEVICE_FOUND_MASK); + device_update_found_by_sysfs(m, sysfs, DEVICE_NOT_FOUND, DEVICE_FOUND_MASK); } else if (device_is_ready(dev)) { @@ -941,7 +941,7 @@ static int device_dispatch_io(sd_device_monitor *monitor, sd_device *dev, void * } else /* The device is nominally around, but not ready for us. Hence unset the udev bit, but leave * the rest around. */ - device_update_found_by_sysfs(m, sysfs, 0, DEVICE_FOUND_UDEV); + device_update_found_by_sysfs(m, sysfs, DEVICE_NOT_FOUND, DEVICE_FOUND_UDEV); return 0; } diff --git a/src/core/mount.c b/src/core/mount.c index b4c058dff4..20b4bb6d2b 100644 --- a/src/core/mount.c +++ b/src/core/mount.c @@ -2070,7 +2070,7 @@ static int mount_process_proc_self_mountinfo(Manager *m) { continue; /* Let the device units know that the device is no longer mounted */ - device_found_node(m, what, 0, DEVICE_FOUND_MOUNT); + device_found_node(m, what, DEVICE_NOT_FOUND, DEVICE_FOUND_MOUNT); } return 0; diff --git a/src/core/swap.c b/src/core/swap.c index 0de73970ad..222c76cf79 100644 --- a/src/core/swap.c +++ b/src/core/swap.c @@ -1249,7 +1249,7 @@ static int swap_process_proc_swaps(Manager *m) { } if (swap->what) - device_found_node(m, swap->what, 0, DEVICE_FOUND_SWAP); + device_found_node(m, swap->what, DEVICE_NOT_FOUND, DEVICE_FOUND_SWAP); } else if (swap->just_activated) { -- 2.25.1