]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/device: use LIST_FOREACH_AFTER() or friend
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 8 Nov 2018 04:02:45 +0000 (13:02 +0900)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 8 Nov 2018 09:58:25 +0000 (10:58 +0100)
src/core/device.c

index 63544297518e753fdc44d4b3aed0f0c9929e9dc8..6c50fd7832b58ec862e41538642100b0a0a91688 100644 (file)
@@ -723,11 +723,11 @@ static Unit *device_following(Unit *u) {
                 return NULL;
 
         /* Make everybody follow the unit that's named after the sysfs path */
-        for (other = d->same_sysfs_next; other; other = other->same_sysfs_next)
+        LIST_FOREACH_AFTER(same_sysfs, other, d)
                 if (startswith(UNIT(other)->id, "sys-"))
                         return UNIT(other);
 
-        for (other = d->same_sysfs_prev; other; other = other->same_sysfs_prev) {
+        LIST_FOREACH_BEFORE(same_sysfs, other, d) {
                 if (startswith(UNIT(other)->id, "sys-"))
                         return UNIT(other);