core/device: use LIST_FOREACH_AFTER() or friend

This commit is contained in:
Yu Watanabe 2018-11-08 13:02:45 +09:00 committed by Zbigniew Jędrzejewski-Szmek
parent bbf1120623
commit 64af816228
1 changed files with 2 additions and 2 deletions

View 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);