]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/device: prefix DEVICE_FOUND_MASK with '_'
authorMike Yuan <me@yhndnzj.com>
Sun, 21 Jul 2024 14:59:19 +0000 (16:59 +0200)
committerMike Yuan <me@yhndnzj.com>
Sun, 21 Jul 2024 20:48:52 +0000 (22:48 +0200)
In accordance to our usual style for special enum values.

src/core/device.c
src/core/device.h

index f8ded6c838e8c6a8423f6710ca985484cc187169..4b62477d2cffa2ab1500a59c586392924610114c 100644 (file)
@@ -332,7 +332,7 @@ static void device_catchup(Unit *u) {
         Device *d = ASSERT_PTR(DEVICE(u));
 
         /* Second, let's update the state with the enumerated state */
-        device_update_found_one(d, d->enumerated_found, DEVICE_FOUND_MASK);
+        device_update_found_one(d, d->enumerated_found, _DEVICE_FOUND_MASK);
 }
 
 static const struct {
@@ -1097,7 +1097,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, DEVICE_NOT_FOUND, 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) {
@@ -1177,7 +1177,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. Note this affects all .device units still point to the removed
                  * device. */
-                device_update_found_by_sysfs(m, sysfs, DEVICE_NOT_FOUND, DEVICE_FOUND_MASK);
+                device_update_found_by_sysfs(m, sysfs, DEVICE_NOT_FOUND, _DEVICE_FOUND_MASK);
 
         /* These devices are found and ready now, set the udev found bit. Note, this is also necessary to do
          * on remove uevent, as some devlinks may be updated and now point to other device nodes. */
index 9dd6fb57c234738a48d464815abf4c9c46b695ec..4eb656777aec10da35102c1c3addfb992f5b6d77 100644 (file)
@@ -14,7 +14,7 @@ typedef enum DeviceFound {
         DEVICE_FOUND_UDEV  = 1 << 0, /* The device has shown up in the udev database */
         DEVICE_FOUND_MOUNT = 1 << 1, /* The device has shown up in /proc/self/mountinfo */
         DEVICE_FOUND_SWAP  = 1 << 2, /* The device has shown up in /proc/swaps */
-        DEVICE_FOUND_MASK  = DEVICE_FOUND_UDEV|DEVICE_FOUND_MOUNT|DEVICE_FOUND_SWAP,
+        _DEVICE_FOUND_MASK = DEVICE_FOUND_UDEV|DEVICE_FOUND_MOUNT|DEVICE_FOUND_SWAP,
 } DeviceFound;
 
 struct Device {