From: Yu Watanabe Date: Thu, 8 Nov 2018 04:02:45 +0000 (+0900) Subject: core/device: use LIST_FOREACH_AFTER() or friend X-Git-Tag: v240~383 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64af81622875a28fd7c46e6232ebd8647ed7fa62;p=thirdparty%2Fsystemd.git core/device: use LIST_FOREACH_AFTER() or friend --- diff --git a/src/core/device.c b/src/core/device.c index 63544297518..6c50fd7832b 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);