From 64af81622875a28fd7c46e6232ebd8647ed7fa62 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 8 Nov 2018 13:02:45 +0900 Subject: [PATCH] core/device: use LIST_FOREACH_AFTER() or friend --- src/core/device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/device.c b/src/core/device.c index 6354429751..6c50fd7832 100644 --- a/src/core/device.c +++ b/src/core/device.c @@ -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);