[systemd-commits] 3 commits - TODO src/bootchart src/core src/gpt-auto-generator src/initctl src/journal src/libsystemd-bus src/login src/machine src/shared src/systemctl src/test src/tmpfiles

Lennart Poettering lennart at kemper.freedesktop.org
Sun Oct 13 21:11:30 PDT 2013


 TODO                                        |   19 ++++++-------------
 src/bootchart/bootchart.c                   |    4 ++--
 src/bootchart/svg.c                         |    2 +-
 src/core/cgroup.c                           |   10 +++++-----
 src/core/dbus-cgroup.c                      |    8 +++-----
 src/core/dbus-job.c                         |    2 +-
 src/core/dbus-unit.c                        |    4 ++--
 src/core/dbus.c                             |    2 +-
 src/core/device.c                           |    4 ++--
 src/core/execute.c                          |    6 +++---
 src/core/job.c                              |   20 ++++++++++----------
 src/core/load-fragment.c                    |   22 +++++++++++-----------
 src/core/manager.c                          |    2 +-
 src/core/path.c                             |    2 +-
 src/core/socket.c                           |    2 +-
 src/core/swap.c                             |    4 ++--
 src/core/timer.c                            |    2 +-
 src/core/transaction.c                      |    4 ++--
 src/core/umount.c                           |   20 ++++++++++----------
 src/core/unit.c                             |   28 ++++++++++++++--------------
 src/gpt-auto-generator/gpt-auto-generator.c |    2 +-
 src/initctl/initctl.c                       |    4 ++--
 src/journal/journal-internal.h              |    2 +-
 src/journal/journald-rate-limit.c           |    8 ++++----
 src/journal/journald-stream.c               |    4 ++--
 src/journal/mmap-cache.c                    |   16 ++++++++--------
 src/journal/sd-journal.c                    |    4 ++--
 src/libsystemd-bus/bus-objects.c            |   16 ++++++++--------
 src/libsystemd-bus/sd-bus.c                 |   14 +++++++-------
 src/login/logind-device.c                   |    6 +++---
 src/login/logind-seat.c                     |    6 +++---
 src/login/logind-session-device.c           |    4 ++--
 src/login/logind-session.c                  |   10 +++++-----
 src/login/logind-user.c                     |    4 ++--
 src/login/logind.c                          |    6 +++---
 src/machine/machine.c                       |    4 ++--
 src/machine/machined.c                      |    2 +-
 src/shared/fdset.h                          |    2 +-
 src/shared/list.h                           |   26 +++++++++++++-------------
 src/shared/set.h                            |    4 ++--
 src/shared/strv.h                           |    2 +-
 src/shared/udev-util.h                      |   10 +++++-----
 src/shared/util.h                           |   19 ++++++++++---------
 src/systemctl/systemctl.c                   |    4 ++--
 src/test/test-list.c                        |   22 +++++++++++-----------
 src/tmpfiles/tmpfiles.c                     |    2 +-
 46 files changed, 181 insertions(+), 189 deletions(-)

New commits:
commit 71fda00f320379f5cbee8e118848de98caaa229d
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Oct 14 06:10:14 2013 +0200

    list: make our list macros a bit easier to use by not requring type spec on each invocation
    
    We can determine the list entry type via the typeof() gcc construct, and
    so we should to make the macros much shorter to use.

diff --git a/TODO b/TODO
index 66cd5b4..3926fe5 100644
--- a/TODO
+++ b/TODO
@@ -58,8 +58,6 @@ Features:
 
 * tmpfiles: when applying ownership to /run/log/journal also do this for the journal fails contained in it
 
-* rework list.h to use typeof() and thus simplify most linked list macros by not requring the type to be specified
-
 * we probably should replace the left-over uses of strv_append() and replace them by strv_push() or strv_extend()
 
 * move config_parse_path_strv() out of conf-parser.c
diff --git a/src/bootchart/bootchart.c b/src/bootchart/bootchart.c
index edbd381..1f40c2e 100644
--- a/src/bootchart/bootchart.c
+++ b/src/bootchart/bootchart.c
@@ -332,7 +332,7 @@ int main(int argc, char *argv[]) {
 
         log_uptime();
 
-        LIST_HEAD_INIT(struct list_sample_data, head);
+        LIST_HEAD_INIT(head);
 
         /* main program loop */
         for (samples = 0; !exiting && samples < arg_samples_len; samples++) {
@@ -406,7 +406,7 @@ int main(int argc, char *argv[]) {
                         /* calculate how many samples we lost and scrap them */
                         arg_samples_len -= (int)(newint_ns / interval);
                 }
-                LIST_PREPEND(struct list_sample_data, link, head, sampledata);
+                LIST_PREPEND(link, head, sampledata);
         }
 
         /* do some cleanup, close fd's */
diff --git a/src/bootchart/svg.c b/src/bootchart/svg.c
index 7ac0138..c088cad 100644
--- a/src/bootchart/svg.c
+++ b/src/bootchart/svg.c
@@ -81,7 +81,7 @@ static void svg_header(void) {
         struct list_sample_data *sampledata_last;
 
         sampledata = head;
-        LIST_FIND_TAIL(struct list_sample_data, link, sampledata, head);
+        LIST_FIND_TAIL(link, sampledata, head);
         sampledata_last = head;
         LIST_FOREACH_BEFORE(link, sampledata, head) {
                 sampledata_last = sampledata;
diff --git a/src/core/cgroup.c b/src/core/cgroup.c
index 8bf4d89..f0a97e6 100644
--- a/src/core/cgroup.c
+++ b/src/core/cgroup.c
@@ -41,7 +41,7 @@ void cgroup_context_free_device_allow(CGroupContext *c, CGroupDeviceAllow *a) {
         assert(c);
         assert(a);
 
-        LIST_REMOVE(CGroupDeviceAllow, device_allow, c->device_allow, a);
+        LIST_REMOVE(device_allow, c->device_allow, a);
         free(a->path);
         free(a);
 }
@@ -50,7 +50,7 @@ void cgroup_context_free_blockio_device_weight(CGroupContext *c, CGroupBlockIODe
         assert(c);
         assert(w);
 
-        LIST_REMOVE(CGroupBlockIODeviceWeight, device_weights, c->blockio_device_weights, w);
+        LIST_REMOVE(device_weights, c->blockio_device_weights, w);
         free(w->path);
         free(w);
 }
@@ -59,7 +59,7 @@ void cgroup_context_free_blockio_device_bandwidth(CGroupContext *c, CGroupBlockI
         assert(c);
         assert(b);
 
-        LIST_REMOVE(CGroupBlockIODeviceBandwidth, device_bandwidths, c->blockio_device_bandwidths, b);
+        LIST_REMOVE(device_bandwidths, c->blockio_device_bandwidths, b);
         free(b->path);
         free(b);
 }
@@ -426,7 +426,7 @@ static int unit_realize_cgroup_now(Unit *u) {
         assert(u);
 
         if (u->in_cgroup_queue) {
-                LIST_REMOVE(Unit, cgroup_queue, u->manager->cgroup_queue, u);
+                LIST_REMOVE(cgroup_queue, u->manager->cgroup_queue, u);
                 u->in_cgroup_queue = false;
         }
 
@@ -450,7 +450,7 @@ static void unit_add_to_cgroup_queue(Unit *u) {
         if (u->in_cgroup_queue)
                 return;
 
-        LIST_PREPEND(Unit, cgroup_queue, u->manager->cgroup_queue, u);
+        LIST_PREPEND(cgroup_queue, u->manager->cgroup_queue, u);
         u->in_cgroup_queue = true;
 }
 
diff --git a/src/core/dbus-cgroup.c b/src/core/dbus-cgroup.c
index 9ebcad9..5654b8c 100644
--- a/src/core/dbus-cgroup.c
+++ b/src/core/dbus-cgroup.c
@@ -273,8 +273,7 @@ int bus_cgroup_set_property(
                                 a->bandwidth = u64;
 
                                 if (!exist)
-                                        LIST_PREPEND(CGroupBlockIODeviceBandwidth, device_bandwidths,
-                                                     c->blockio_device_bandwidths, a);
+                                        LIST_PREPEND(device_bandwidths, c->blockio_device_bandwidths, a);
                         }
 
                         n++;
@@ -369,8 +368,7 @@ int bus_cgroup_set_property(
                                 a->weight = ul;
 
                                 if (!exist)
-                                        LIST_PREPEND(CGroupBlockIODeviceWeight, device_weights,
-                                                     c->blockio_device_weights, a);
+                                        LIST_PREPEND(device_weights,c->blockio_device_weights, a);
                         }
 
                         n++;
@@ -517,7 +515,7 @@ int bus_cgroup_set_property(
                                 a->m = !!strchr(rwm, 'm');
 
                                 if (!exist)
-                                        LIST_PREPEND(CGroupDeviceAllow, device_allow, c->device_allow, a);
+                                        LIST_PREPEND(device_allow, c->device_allow, a);
                         }
 
                         n++;
diff --git a/src/core/dbus-job.c b/src/core/dbus-job.c
index 4ab88d0..eac2448 100644
--- a/src/core/dbus-job.c
+++ b/src/core/dbus-job.c
@@ -319,7 +319,7 @@ void bus_job_send_change_signal(Job *j) {
         assert(j);
 
         if (j->in_dbus_queue) {
-                LIST_REMOVE(Job, dbus_queue, j->manager->dbus_job_queue, j);
+                LIST_REMOVE(dbus_queue, j->manager->dbus_job_queue, j);
                 j->in_dbus_queue = false;
         }
 
diff --git a/src/core/dbus-unit.c b/src/core/dbus-unit.c
index 2ea59b2..b6f5c39 100644
--- a/src/core/dbus-unit.c
+++ b/src/core/dbus-unit.c
@@ -627,7 +627,7 @@ void bus_unit_send_change_signal(Unit *u) {
         assert(u);
 
         if (u->in_dbus_queue) {
-                LIST_REMOVE(Unit, dbus_queue, u->manager->dbus_unit_queue, u);
+                LIST_REMOVE(dbus_queue, u->manager->dbus_unit_queue, u);
                 u->in_dbus_queue = false;
         }
 
@@ -801,7 +801,7 @@ DBusHandlerResult bus_unit_queue_job(
         if (!cl)
                 goto oom;
 
-        LIST_PREPEND(JobBusClient, client, j->bus_client_list, cl);
+        LIST_PREPEND(client, j->bus_client_list, cl);
 
         reply = dbus_message_new_method_return(message);
         if (!reply)
diff --git a/src/core/dbus.c b/src/core/dbus.c
index aa3d93b..771ba01 100644
--- a/src/core/dbus.c
+++ b/src/core/dbus.c
@@ -1170,7 +1170,7 @@ static void shutdown_connection(Manager *m, DBusConnection *c) {
                 JobBusClient *cl, *nextcl;
                 LIST_FOREACH_SAFE(client, cl, nextcl, j->bus_client_list) {
                         if (cl->bus == c) {
-                                LIST_REMOVE(JobBusClient, client, j->bus_client_list, cl);
+                                LIST_REMOVE(client, j->bus_client_list, cl);
                                 free(cl);
                         }
                 }
diff --git a/src/core/device.c b/src/core/device.c
index 25af2cb..0595015 100644
--- a/src/core/device.c
+++ b/src/core/device.c
@@ -48,7 +48,7 @@ static void device_unset_sysfs(Device *d) {
         /* Remove this unit from the chain of devices which share the
          * same sysfs path. */
         first = hashmap_get(UNIT(d)->manager->devices_by_sysfs, d->sysfs);
-        LIST_REMOVE(Device, same_sysfs, first, d);
+        LIST_REMOVE(same_sysfs, first, d);
 
         if (first)
                 hashmap_remove_and_replace(UNIT(d)->manager->devices_by_sysfs, d->sysfs, first->sysfs, first);
@@ -234,7 +234,7 @@ static int device_update_unit(Manager *m, struct udev_device *dev, const char *p
                         }
 
                 first = hashmap_get(m->devices_by_sysfs, sysfs);
-                LIST_PREPEND(Device, same_sysfs, first, DEVICE(u));
+                LIST_PREPEND(same_sysfs, first, DEVICE(u));
 
                 r = hashmap_replace(m->devices_by_sysfs, DEVICE(u)->sysfs, first);
                 if (r < 0)
diff --git a/src/core/execute.c b/src/core/execute.c
index 3f7ca52..b48b1ae 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -1706,7 +1706,7 @@ void exec_command_free_list(ExecCommand *c) {
         ExecCommand *i;
 
         while ((i = c)) {
-                LIST_REMOVE(ExecCommand, command, c, i);
+                LIST_REMOVE(command, c, i);
                 exec_command_done(i);
                 free(i);
         }
@@ -2194,8 +2194,8 @@ void exec_command_append_list(ExecCommand **l, ExecCommand *e) {
 
         if (*l) {
                 /* It's kind of important, that we keep the order here */
-                LIST_FIND_TAIL(ExecCommand, command, *l, end);
-                LIST_INSERT_AFTER(ExecCommand, command, *l, end, e);
+                LIST_FIND_TAIL(command, *l, end);
+                LIST_INSERT_AFTER(command, *l, end, e);
         } else
               *l = e;
 }
diff --git a/src/core/job.c b/src/core/job.c
index bf1d956..e5dcef7 100644
--- a/src/core/job.c
+++ b/src/core/job.c
@@ -99,10 +99,10 @@ void job_free(Job *j) {
         assert(!j->object_list);
 
         if (j->in_run_queue)
-                LIST_REMOVE(Job, run_queue, j->manager->run_queue, j);
+                LIST_REMOVE(run_queue, j->manager->run_queue, j);
 
         if (j->in_dbus_queue)
-                LIST_REMOVE(Job, dbus_queue, j->manager->dbus_job_queue, j);
+                LIST_REMOVE(dbus_queue, j->manager->dbus_job_queue, j);
 
         if (j->timer_watch.type != WATCH_INVALID) {
                 assert(j->timer_watch.type == WATCH_JOB_TIMER);
@@ -114,7 +114,7 @@ void job_free(Job *j) {
         }
 
         while ((cl = j->bus_client_list)) {
-                LIST_REMOVE(JobBusClient, client, j->bus_client_list, cl);
+                LIST_REMOVE(client, j->bus_client_list, cl);
                 free(cl);
         }
         free(j);
@@ -267,9 +267,9 @@ JobDependency* job_dependency_new(Job *subject, Job *object, bool matters, bool
         l->conflicts = conflicts;
 
         if (subject)
-                LIST_PREPEND(JobDependency, subject, subject->subject_list, l);
+                LIST_PREPEND(subject, subject->subject_list, l);
 
-        LIST_PREPEND(JobDependency, object, object->object_list, l);
+        LIST_PREPEND(object, object->object_list, l);
 
         return l;
 }
@@ -278,9 +278,9 @@ void job_dependency_free(JobDependency *l) {
         assert(l);
 
         if (l->subject)
-                LIST_REMOVE(JobDependency, subject, l->subject->subject_list, l);
+                LIST_REMOVE(subject, l->subject->subject_list, l);
 
-        LIST_REMOVE(JobDependency, object, l->object->object_list, l);
+        LIST_REMOVE(object, l->object->object_list, l);
 
         free(l);
 }
@@ -491,7 +491,7 @@ int job_run_and_invalidate(Job *j) {
         assert(j->type < _JOB_TYPE_MAX_IN_TRANSACTION);
         assert(j->in_run_queue);
 
-        LIST_REMOVE(Job, run_queue, j->manager->run_queue, j);
+        LIST_REMOVE(run_queue, j->manager->run_queue, j);
         j->in_run_queue = false;
 
         if (j->state != JOB_WAITING)
@@ -910,7 +910,7 @@ void job_add_to_run_queue(Job *j) {
         if (j->in_run_queue)
                 return;
 
-        LIST_PREPEND(Job, run_queue, j->manager->run_queue, j);
+        LIST_PREPEND(run_queue, j->manager->run_queue, j);
         j->in_run_queue = true;
 }
 
@@ -925,7 +925,7 @@ void job_add_to_dbus_queue(Job *j) {
          * job might just have been created and not yet assigned to a
          * connection/client. */
 
-        LIST_PREPEND(Job, dbus_queue, j->manager->dbus_job_queue, j);
+        LIST_PREPEND(dbus_queue, j->manager->dbus_job_queue, j);
         j->in_dbus_queue = true;
 }
 
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index f01843d..fb7efca 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -300,10 +300,10 @@ int config_parse_socket_listen(const char *unit,
         p->fd = -1;
 
         if (s->ports) {
-                LIST_FIND_TAIL(SocketPort, port, s->ports, tail);
-                LIST_INSERT_AFTER(SocketPort, port, s->ports, tail, p);
+                LIST_FIND_TAIL(port, s->ports, tail);
+                LIST_INSERT_AFTER(port, s->ports, tail, p);
         } else
-                LIST_PREPEND(SocketPort, port, s->ports, p);
+                LIST_PREPEND(port, s->ports, p);
 
         return 0;
 }
@@ -1203,7 +1203,7 @@ int config_parse_timer(const char *unit,
         v->value = u;
         v->calendar_spec = c;
 
-        LIST_PREPEND(TimerValue, value, t->values, v);
+        LIST_PREPEND(value, t->values, v);
 
         return 0;
 }
@@ -1323,7 +1323,7 @@ int config_parse_path_spec(const char *unit,
         s->type = b;
         s->inotify_fd = -1;
 
-        LIST_PREPEND(PathSpec, spec, p->specs, s);
+        LIST_PREPEND(spec, p->specs, s);
 
         return 0;
 }
@@ -1657,7 +1657,7 @@ int config_parse_unit_condition_path(const char *unit,
         if (!c)
                 return log_oom();
 
-        LIST_PREPEND(Condition, conditions, u->conditions, c);
+        LIST_PREPEND(conditions, u->conditions, c);
         return 0;
 }
 
@@ -1712,7 +1712,7 @@ int config_parse_unit_condition_string(const char *unit,
         if (!c)
                 return log_oom();
 
-        LIST_PREPEND(Condition, conditions, u->conditions, c);
+        LIST_PREPEND(conditions, u->conditions, c);
         return 0;
 }
 
@@ -1766,7 +1766,7 @@ int config_parse_unit_condition_null(const char *unit,
         if (!c)
                 return log_oom();
 
-        LIST_PREPEND(Condition, conditions, u->conditions, c);
+        LIST_PREPEND(conditions, u->conditions, c);
         return 0;
 }
 
@@ -2128,7 +2128,7 @@ int config_parse_device_allow(
         a->w = !!strchr(m, 'w');
         a->m = !!strchr(m, 'm');
 
-        LIST_PREPEND(CGroupDeviceAllow, device_allow, c->device_allow, a);
+        LIST_PREPEND(device_allow, c->device_allow, a);
         return 0;
 }
 
@@ -2234,7 +2234,7 @@ int config_parse_blockio_device_weight(
 
         w->weight = lu;
 
-        LIST_PREPEND(CGroupBlockIODeviceWeight, device_weights, c->blockio_device_weights, w);
+        LIST_PREPEND(device_weights, c->blockio_device_weights, w);
         return 0;
 }
 
@@ -2310,7 +2310,7 @@ int config_parse_blockio_bandwidth(
         b->bandwidth = (uint64_t) bytes;
         b->read = read;
 
-        LIST_PREPEND(CGroupBlockIODeviceBandwidth, device_bandwidths, c->blockio_device_bandwidths, b);
+        LIST_PREPEND(device_bandwidths, c->blockio_device_bandwidths, b);
 
         return 0;
 }
diff --git a/src/core/manager.c b/src/core/manager.c
index 56191bf..01db2b0 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -676,7 +676,7 @@ static unsigned manager_dispatch_gc_queue(Manager *m) {
 
                 unit_gc_sweep(u, gc_marker);
 
-                LIST_REMOVE(Unit, gc_queue, m->gc_queue, u);
+                LIST_REMOVE(gc_queue, m->gc_queue, u);
                 u->in_gc_queue = false;
 
                 n++;
diff --git a/src/core/path.c b/src/core/path.c
index 99e2fed..10df80f 100644
--- a/src/core/path.c
+++ b/src/core/path.c
@@ -283,7 +283,7 @@ void path_free_specs(Path *p) {
 
         while ((s = p->specs)) {
                 path_spec_unwatch(s, UNIT(p));
-                LIST_REMOVE(PathSpec, spec, p->specs, s);
+                LIST_REMOVE(spec, p->specs, s);
                 path_spec_done(s);
                 free(s);
         }
diff --git a/src/core/socket.c b/src/core/socket.c
index ae92408..0c03e83 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -110,7 +110,7 @@ void socket_free_ports(Socket *s) {
         assert(s);
 
         while ((p = s->ports)) {
-                LIST_REMOVE(SocketPort, port, s->ports, p);
+                LIST_REMOVE(port, s->ports, p);
 
                 if (p->fd >= 0) {
                         unit_unwatch_fd(UNIT(s), &p->fd_watch);
diff --git a/src/core/swap.c b/src/core/swap.c
index a68ab7c..8e494e9 100644
--- a/src/core/swap.c
+++ b/src/core/swap.c
@@ -66,7 +66,7 @@ static void swap_unset_proc_swaps(Swap *s) {
          * same kernel swap device. */
         swaps = UNIT(s)->manager->swaps_by_proc_swaps;
         first = hashmap_get(swaps, s->parameters_proc_swaps.what);
-        LIST_REMOVE(Swap, same_proc_swaps, first, s);
+        LIST_REMOVE(same_proc_swaps, first, s);
 
         if (first)
                 hashmap_remove_and_replace(swaps,
@@ -364,7 +364,7 @@ static int swap_add_one(
                 p->what = wp;
 
                 first = hashmap_get(m->swaps_by_proc_swaps, wp);
-                LIST_PREPEND(Swap, same_proc_swaps, first, SWAP(u));
+                LIST_PREPEND(same_proc_swaps, first, SWAP(u));
 
                 r = hashmap_replace(m->swaps_by_proc_swaps, wp, first);
                 if (r < 0)
diff --git a/src/core/timer.c b/src/core/timer.c
index 9166c1e..b90c85f 100644
--- a/src/core/timer.c
+++ b/src/core/timer.c
@@ -54,7 +54,7 @@ void timer_free_values(Timer *t) {
         assert(t);
 
         while ((v = t->values)) {
-                LIST_REMOVE(TimerValue, value, t->values, v);
+                LIST_REMOVE(value, t->values, v);
 
                 if (v->calendar_spec)
                         calendar_spec_free(v->calendar_spec);
diff --git a/src/core/transaction.c b/src/core/transaction.c
index 203070f..ba7d8d9 100644
--- a/src/core/transaction.c
+++ b/src/core/transaction.c
@@ -775,10 +775,10 @@ static Job* transaction_add_one_job(Transaction *tr, JobType type, Unit *unit, b
         j->override = override;
         j->irreversible = tr->irreversible;
 
-        LIST_PREPEND(Job, transaction, f, j);
+        LIST_PREPEND(transaction, f, j);
 
         if (hashmap_replace(tr->jobs, unit, f) < 0) {
-                LIST_REMOVE(Job, transaction, f, j);
+                LIST_REMOVE(transaction, f, j);
                 job_free(j);
                 return NULL;
         }
diff --git a/src/core/umount.c b/src/core/umount.c
index 99dbe27..e7460cb 100644
--- a/src/core/umount.c
+++ b/src/core/umount.c
@@ -40,14 +40,14 @@
 typedef struct MountPoint {
         char *path;
         dev_t devnum;
-        LIST_FIELDS (struct MountPoint, mount_point);
+        LIST_FIELDS(struct MountPoint, mount_point);
 } MountPoint;
 
 static void mount_point_free(MountPoint **head, MountPoint *m) {
         assert(head);
         assert(m);
 
-        LIST_REMOVE(MountPoint, mount_point, *head, m);
+        LIST_REMOVE(mount_point, *head, m);
 
         free(m->path);
         free(m);
@@ -125,7 +125,7 @@ static int mount_points_list_get(MountPoint **head) {
                 }
 
                 m->path = p;
-                LIST_PREPEND(MountPoint, mount_point, *head, m);
+                LIST_PREPEND(mount_point, *head, m);
         }
 
         r = 0;
@@ -190,7 +190,7 @@ static int swap_list_get(MountPoint **head) {
                 }
 
                 swap->path = d;
-                LIST_PREPEND(MountPoint, mount_point, *head, swap);
+                LIST_PREPEND(mount_point, *head, swap);
         }
 
         r = 0;
@@ -250,7 +250,7 @@ static int loopback_list_get(MountPoint **head) {
                 }
 
                 lb->path = loop;
-                LIST_PREPEND(MountPoint, mount_point, *head, lb);
+                LIST_PREPEND(mount_point, *head, lb);
         }
 
         return 0;
@@ -308,7 +308,7 @@ static int dm_list_get(MountPoint **head) {
 
                 m->path = node;
                 m->devnum = devnum;
-                LIST_PREPEND(MountPoint, mount_point, *head, m);
+                LIST_PREPEND(mount_point, *head, m);
         }
 
         return 0;
@@ -513,7 +513,7 @@ int umount_all(bool *changed) {
         bool umount_changed;
         LIST_HEAD(MountPoint, mp_list_head);
 
-        LIST_HEAD_INIT(MountPoint, mp_list_head);
+        LIST_HEAD_INIT(mp_list_head);
         r = mount_points_list_get(&mp_list_head);
         if (r < 0)
                 goto end;
@@ -543,7 +543,7 @@ int swapoff_all(bool *changed) {
         int r;
         LIST_HEAD(MountPoint, swap_list_head);
 
-        LIST_HEAD_INIT(MountPoint, swap_list_head);
+        LIST_HEAD_INIT(swap_list_head);
 
         r = swap_list_get(&swap_list_head);
         if (r < 0)
@@ -561,7 +561,7 @@ int loopback_detach_all(bool *changed) {
         int r;
         LIST_HEAD(MountPoint, loopback_list_head);
 
-        LIST_HEAD_INIT(MountPoint, loopback_list_head);
+        LIST_HEAD_INIT(loopback_list_head);
 
         r = loopback_list_get(&loopback_list_head);
         if (r < 0)
@@ -579,7 +579,7 @@ int dm_detach_all(bool *changed) {
         int r;
         LIST_HEAD(MountPoint, dm_list_head);
 
-        LIST_HEAD_INIT(MountPoint, dm_list_head);
+        LIST_HEAD_INIT(dm_list_head);
 
         r = dm_list_get(&dm_list_head);
         if (r < 0)
diff --git a/src/core/unit.c b/src/core/unit.c
index 1db7d06..e19d281 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -171,7 +171,7 @@ int unit_add_name(Unit *u, const char *text) {
                 u->id = s;
                 u->instance = i;
 
-                LIST_PREPEND(Unit, units_by_type, u->manager->units_by_type[t], u);
+                LIST_PREPEND(units_by_type, u->manager->units_by_type[t], u);
 
                 if (UNIT_VTABLE(u)->init)
                         UNIT_VTABLE(u)->init(u);
@@ -284,7 +284,7 @@ void unit_add_to_load_queue(Unit *u) {
         if (u->load_state != UNIT_STUB || u->in_load_queue)
                 return;
 
-        LIST_PREPEND(Unit, load_queue, u->manager->load_queue, u);
+        LIST_PREPEND(load_queue, u->manager->load_queue, u);
         u->in_load_queue = true;
 }
 
@@ -294,7 +294,7 @@ void unit_add_to_cleanup_queue(Unit *u) {
         if (u->in_cleanup_queue)
                 return;
 
-        LIST_PREPEND(Unit, cleanup_queue, u->manager->cleanup_queue, u);
+        LIST_PREPEND(cleanup_queue, u->manager->cleanup_queue, u);
         u->in_cleanup_queue = true;
 }
 
@@ -307,7 +307,7 @@ void unit_add_to_gc_queue(Unit *u) {
         if (unit_check_gc(u))
                 return;
 
-        LIST_PREPEND(Unit, gc_queue, u->manager->gc_queue, u);
+        LIST_PREPEND(gc_queue, u->manager->gc_queue, u);
         u->in_gc_queue = true;
 
         u->manager->n_in_gc_queue ++;
@@ -326,7 +326,7 @@ void unit_add_to_dbus_queue(Unit *u) {
                 return;
         }
 
-        LIST_PREPEND(Unit, dbus_queue, u->manager->dbus_unit_queue, u);
+        LIST_PREPEND(dbus_queue, u->manager->dbus_unit_queue, u);
         u->in_dbus_queue = true;
 }
 
@@ -439,24 +439,24 @@ void unit_free(Unit *u) {
                 bidi_set_free(u, u->dependencies[d]);
 
         if (u->type != _UNIT_TYPE_INVALID)
-                LIST_REMOVE(Unit, units_by_type, u->manager->units_by_type[u->type], u);
+                LIST_REMOVE(units_by_type, u->manager->units_by_type[u->type], u);
 
         if (u->in_load_queue)
-                LIST_REMOVE(Unit, load_queue, u->manager->load_queue, u);
+                LIST_REMOVE(load_queue, u->manager->load_queue, u);
 
         if (u->in_dbus_queue)
-                LIST_REMOVE(Unit, dbus_queue, u->manager->dbus_unit_queue, u);
+                LIST_REMOVE(dbus_queue, u->manager->dbus_unit_queue, u);
 
         if (u->in_cleanup_queue)
-                LIST_REMOVE(Unit, cleanup_queue, u->manager->cleanup_queue, u);
+                LIST_REMOVE(cleanup_queue, u->manager->cleanup_queue, u);
 
         if (u->in_gc_queue) {
-                LIST_REMOVE(Unit, gc_queue, u->manager->gc_queue, u);
+                LIST_REMOVE(gc_queue, u->manager->gc_queue, u);
                 u->manager->n_in_gc_queue--;
         }
 
         if (u->in_cgroup_queue)
-                LIST_REMOVE(Unit, cgroup_queue, u->manager->cgroup_queue, u);
+                LIST_REMOVE(cgroup_queue, u->manager->cgroup_queue, u);
 
         if (u->cgroup_path) {
                 hashmap_remove(u->manager->cgroup_unit, u->cgroup_path);
@@ -952,7 +952,7 @@ int unit_load(Unit *u) {
         assert(u);
 
         if (u->in_load_queue) {
-                LIST_REMOVE(Unit, load_queue, u->manager->load_queue, u);
+                LIST_REMOVE(load_queue, u->manager->load_queue, u);
                 u->in_load_queue = false;
         }
 
@@ -2670,7 +2670,7 @@ Unit* unit_ref_set(UnitRef *ref, Unit *u) {
                 unit_ref_unset(ref);
 
         ref->unit = u;
-        LIST_PREPEND(UnitRef, refs, u->refs, ref);
+        LIST_PREPEND(refs, u->refs, ref);
         return u;
 }
 
@@ -2680,7 +2680,7 @@ void unit_ref_unset(UnitRef *ref) {
         if (!ref->unit)
                 return;
 
-        LIST_REMOVE(UnitRef, refs, ref->unit->refs, ref);
+        LIST_REMOVE(refs, ref->unit->refs, ref);
         ref->unit = NULL;
 }
 
diff --git a/src/initctl/initctl.c b/src/initctl/initctl.c
index ec33040..d5411bd 100644
--- a/src/initctl/initctl.c
+++ b/src/initctl/initctl.c
@@ -251,7 +251,7 @@ static void fifo_free(Fifo *f) {
         if (f->server) {
                 assert(f->server->n_fifos > 0);
                 f->server->n_fifos--;
-                LIST_REMOVE(Fifo, fifo, f->server->fifos, f);
+                LIST_REMOVE(fifo, f->server->fifos, f);
         }
 
         if (f->fd >= 0) {
@@ -341,7 +341,7 @@ static int server_init(Server *s, unsigned n_sockets) {
                 }
 
                 f->fd = fd;
-                LIST_PREPEND(Fifo, fifo, s->fifos, f);
+                LIST_PREPEND(fifo, s->fifos, f);
                 f->server = s;
                 s->n_fifos ++;
         }
diff --git a/src/journal/journald-rate-limit.c b/src/journal/journald-rate-limit.c
index 32e35a9..4b76221 100644
--- a/src/journal/journald-rate-limit.c
+++ b/src/journal/journald-rate-limit.c
@@ -96,8 +96,8 @@ static void journal_rate_limit_group_free(JournalRateLimitGroup *g) {
                 if (g->parent->lru_tail == g)
                         g->parent->lru_tail = g->lru_prev;
 
-                LIST_REMOVE(JournalRateLimitGroup, lru, g->parent->lru, g);
-                LIST_REMOVE(JournalRateLimitGroup, bucket, g->parent->buckets[g->hash % BUCKETS_MAX], g);
+                LIST_REMOVE(lru, g->parent->lru, g);
+                LIST_REMOVE(bucket, g->parent->buckets[g->hash % BUCKETS_MAX], g);
 
                 g->parent->n_groups --;
         }
@@ -156,8 +156,8 @@ static JournalRateLimitGroup* journal_rate_limit_group_new(JournalRateLimit *r,
 
         journal_rate_limit_vacuum(r, ts);
 
-        LIST_PREPEND(JournalRateLimitGroup, bucket, r->buckets[g->hash % BUCKETS_MAX], g);
-        LIST_PREPEND(JournalRateLimitGroup, lru, r->lru, g);
+        LIST_PREPEND(bucket, r->buckets[g->hash % BUCKETS_MAX], g);
+        LIST_PREPEND(lru, r->lru, g);
         if (!g->lru_next)
                 r->lru_tail = g;
         r->n_groups ++;
diff --git a/src/journal/journald-stream.c b/src/journal/journald-stream.c
index 543614a..9ca26e2 100644
--- a/src/journal/journald-stream.c
+++ b/src/journal/journald-stream.c
@@ -324,7 +324,7 @@ void stdout_stream_free(StdoutStream *s) {
         if (s->server) {
                 assert(s->server->n_stdout_streams > 0);
                 s->server->n_stdout_streams --;
-                LIST_REMOVE(StdoutStream, stdout_stream, s->server->stdout_streams, s);
+                LIST_REMOVE(stdout_stream, s->server->stdout_streams, s);
         }
 
         if (s->fd >= 0) {
@@ -404,7 +404,7 @@ int stdout_stream_new(Server *s) {
         }
 
         stream->server = s;
-        LIST_PREPEND(StdoutStream, stdout_stream, s->stdout_streams, stream);
+        LIST_PREPEND(stdout_stream, s->stdout_streams, stream);
         s->n_stdout_streams ++;
 
         return 0;
diff --git a/src/journal/mmap-cache.c b/src/journal/mmap-cache.c
index 03b57be..6c9194a 100644
--- a/src/journal/mmap-cache.c
+++ b/src/journal/mmap-cache.c
@@ -110,13 +110,13 @@ static void window_unlink(Window *w) {
                 munmap(w->ptr, w->size);
 
         if (w->fd)
-                LIST_REMOVE(Window, by_fd, w->fd->windows, w);
+                LIST_REMOVE(by_fd, w->fd->windows, w);
 
         if (w->in_unused) {
                 if (w->cache->last_unused == w)
                         w->cache->last_unused = w->unused_prev;
 
-                LIST_REMOVE(Window, unused, w->cache->unused, w);
+                LIST_REMOVE(unused, w->cache->unused, w);
         }
 
         LIST_FOREACH(by_window, c, w->contexts) {
@@ -180,11 +180,11 @@ static void context_detach_window(Context *c) {
 
         w = c->window;
         c->window = NULL;
-        LIST_REMOVE(Context, by_window, w->contexts, c);
+        LIST_REMOVE(by_window, w->contexts, c);
 
         if (!w->contexts && !w->keep_always) {
                 /* Not used anymore? */
-                LIST_PREPEND(Window, unused, c->cache->unused, w);
+                LIST_PREPEND(unused, c->cache->unused, w);
                 if (!c->cache->last_unused)
                         c->cache->last_unused = w;
 
@@ -203,7 +203,7 @@ static void context_attach_window(Context *c, Window *w) {
 
         if (w->in_unused) {
                 /* Used again? */
-                LIST_REMOVE(Window, unused, c->cache->unused, w);
+                LIST_REMOVE(unused, c->cache->unused, w);
                 if (c->cache->last_unused == w)
                         c->cache->last_unused = w->unused_prev;
 
@@ -211,7 +211,7 @@ static void context_attach_window(Context *c, Window *w) {
         }
 
         c->window = w;
-        LIST_PREPEND(Context, by_window, w->contexts, c);
+        LIST_PREPEND(by_window, w->contexts, c);
 }
 
 static Context *context_add(MMapCache *m, unsigned id) {
@@ -511,11 +511,11 @@ static int add_mmap(
         w->size = wsize;
         w->fd = f;
 
-        LIST_PREPEND(Window, by_fd, f->windows, w);
+        LIST_PREPEND(by_fd, f->windows, w);
 
         context_detach_window(c);
         c->window = w;
-        LIST_PREPEND(Context, by_window, w->contexts, c);
+        LIST_PREPEND(by_window, w->contexts, c);
 
         *ret = (uint8_t*) w->ptr + (offset - w->offset);
         return 1;
diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
index 7700d6c..3ccb14a 100644
--- a/src/journal/sd-journal.c
+++ b/src/journal/sd-journal.c
@@ -186,7 +186,7 @@ static Match *match_new(Match *p, MatchType t) {
 
         if (p) {
                 m->parent = p;
-                LIST_PREPEND(Match, matches, p->matches, m);
+                LIST_PREPEND(matches, p->matches, m);
         }
 
         return m;
@@ -199,7 +199,7 @@ static void match_free(Match *m) {
                 match_free(m->matches);
 
         if (m->parent)
-                LIST_REMOVE(Match, matches, m->parent->matches, m);
+                LIST_REMOVE(matches, m->parent->matches, m);
 
         free(m->data);
         free(m);
diff --git a/src/libsystemd-bus/bus-objects.c b/src/libsystemd-bus/bus-objects.c
index 1d32566..cd56d13 100644
--- a/src/libsystemd-bus/bus-objects.c
+++ b/src/libsystemd-bus/bus-objects.c
@@ -1196,7 +1196,7 @@ static struct node *bus_node_allocate(sd_bus *bus, const char *path) {
         }
 
         if (parent)
-                LIST_PREPEND(struct node, siblings, parent->child, n);
+                LIST_PREPEND(siblings, parent->child, n);
 
         return n;
 }
@@ -1217,7 +1217,7 @@ static void bus_node_gc(sd_bus *b, struct node *n) {
         assert(hashmap_remove(b->nodes, n->path) == n);
 
         if (n->parent)
-                LIST_REMOVE(struct node, siblings, n->parent->child, n);
+                LIST_REMOVE(siblings, n->parent->child, n);
 
         free(n->path);
         bus_node_gc(b, n->parent);
@@ -1255,7 +1255,7 @@ static int bus_add_object(
         c->userdata = userdata;
         c->is_fallback = fallback;
 
-        LIST_PREPEND(struct node_callback, callbacks, n->callbacks, c);
+        LIST_PREPEND(callbacks, n->callbacks, c);
         return 0;
 
 fail:
@@ -1289,7 +1289,7 @@ static int bus_remove_object(
         if (!c)
                 return 0;
 
-        LIST_REMOVE(struct node_callback, callbacks, n->callbacks, c);
+        LIST_REMOVE(callbacks, n->callbacks, c);
         free(c);
 
         bus_node_gc(bus, n);
@@ -1546,7 +1546,7 @@ static int add_object_vtable_internal(
                 }
         }
 
-        LIST_PREPEND(struct node_vtable, vtables, n->vtables, c);
+        LIST_PREPEND(vtables, n->vtables, c);
         return 0;
 
 fail:
@@ -1582,7 +1582,7 @@ static int remove_object_vtable_internal(
         if (!c)
                 return 0;
 
-        LIST_REMOVE(struct node_vtable, vtables, n->vtables, c);
+        LIST_REMOVE(vtables, n->vtables, c);
 
         free_node_vtable(bus, c);
         bus_node_gc(bus, n);
@@ -1656,7 +1656,7 @@ int sd_bus_add_node_enumerator(
         c->callback = callback;
         c->userdata = userdata;
 
-        LIST_PREPEND(struct node_enumerator, enumerators, n->enumerators, c);
+        LIST_PREPEND(enumerators, n->enumerators, c);
         return 0;
 
 fail:
@@ -1690,7 +1690,7 @@ int sd_bus_remove_node_enumerator(
         if (!c)
                 return 0;
 
-        LIST_REMOVE(struct node_enumerator, enumerators, n->enumerators, c);
+        LIST_REMOVE(enumerators, n->enumerators, c);
         free(c);
 
         bus_node_gc(bus, n);
diff --git a/src/libsystemd-bus/sd-bus.c b/src/libsystemd-bus/sd-bus.c
index ca687c0..d9f9dfd 100644
--- a/src/libsystemd-bus/sd-bus.c
+++ b/src/libsystemd-bus/sd-bus.c
@@ -74,23 +74,23 @@ static void bus_node_destroy(sd_bus *b, struct node *n) {
                 bus_node_destroy(b, n->child);
 
         while ((c = n->callbacks)) {
-                LIST_REMOVE(struct node_callback, callbacks, n->callbacks, c);
+                LIST_REMOVE(callbacks, n->callbacks, c);
                 free(c);
         }
 
         while ((v = n->vtables)) {
-                LIST_REMOVE(struct node_vtable, vtables, n->vtables, v);
+                LIST_REMOVE(vtables, n->vtables, v);
                 free(v->interface);
                 free(v);
         }
 
         while ((e = n->enumerators)) {
-                LIST_REMOVE(struct node_enumerator, enumerators, n->enumerators, e);
+                LIST_REMOVE(enumerators, n->enumerators, e);
                 free(e);
         }
 
         if (n->parent)
-                LIST_REMOVE(struct node, siblings, n->parent->child, n);
+                LIST_REMOVE(siblings, n->parent->child, n);
 
         assert_se(hashmap_remove(b->nodes, n->path) == n);
         free(n->path);
@@ -133,7 +133,7 @@ static void bus_free(sd_bus *b) {
         prioq_free(b->reply_callbacks_prioq);
 
         while ((f = b->filter_callbacks)) {
-                LIST_REMOVE(struct filter_callback, callbacks, b->filter_callbacks, f);
+                LIST_REMOVE(callbacks, b->filter_callbacks, f);
                 free(f);
         }
 
@@ -2127,7 +2127,7 @@ int sd_bus_add_filter(sd_bus *bus, sd_bus_message_handler_t callback, void *user
         f->userdata = userdata;
 
         bus->filter_callbacks_modified = true;
-        LIST_PREPEND(struct filter_callback, callbacks, bus->filter_callbacks, f);
+        LIST_PREPEND(callbacks, bus->filter_callbacks, f);
         return 0;
 }
 
@@ -2144,7 +2144,7 @@ int sd_bus_remove_filter(sd_bus *bus, sd_bus_message_handler_t callback, void *u
         LIST_FOREACH(callbacks, f, bus->filter_callbacks) {
                 if (f->callback == callback && f->userdata == userdata) {
                         bus->filter_callbacks_modified = true;
-                        LIST_REMOVE(struct filter_callback, callbacks, bus->filter_callbacks, f);
+                        LIST_REMOVE(callbacks, bus->filter_callbacks, f);
                         free(f);
                         return 1;
                 }
diff --git a/src/login/logind-device.c b/src/login/logind-device.c
index 95c2307..9ff91ba 100644
--- a/src/login/logind-device.c
+++ b/src/login/logind-device.c
@@ -77,7 +77,7 @@ void device_detach(Device *d) {
                 session_device_free(sd);
 
         s = d->seat;
-        LIST_REMOVE(Device, devices, d->seat->devices, d);
+        LIST_REMOVE(devices, d->seat->devices, d);
         d->seat = NULL;
 
         if (!seat_has_master_device(s)) {
@@ -110,11 +110,11 @@ void device_attach(Device *d, Seat *s) {
          * per seat, so we iterate only a few times. */
 
         if (d->master || !s->devices)
-                LIST_PREPEND(Device, devices, s->devices, d);
+                LIST_PREPEND(devices, s->devices, d);
         else {
                 LIST_FOREACH(devices, i, s->devices) {
                         if (!i->devices_next || !i->master) {
-                                LIST_INSERT_AFTER(Device, devices, s->devices, i, d);
+                                LIST_INSERT_AFTER(devices, s->devices, i, d);
                                 break;
                         }
                 }
diff --git a/src/login/logind-seat.c b/src/login/logind-seat.c
index feebcf4..6f3299b 100644
--- a/src/login/logind-seat.c
+++ b/src/login/logind-seat.c
@@ -67,7 +67,7 @@ void seat_free(Seat *s) {
         assert(s);
 
         if (s->in_gc_queue)
-                LIST_REMOVE(Seat, gc_queue, s->manager->seat_gc_queue, s);
+                LIST_REMOVE(gc_queue, s->manager->seat_gc_queue, s);
 
         while (s->sessions)
                 session_free(s->sessions);
@@ -415,7 +415,7 @@ int seat_attach_session(Seat *s, Session *session) {
         assert(!session->seat);
 
         session->seat = s;
-        LIST_PREPEND(Session, sessions_by_seat, s->sessions, session);
+        LIST_PREPEND(sessions_by_seat, s->sessions, session);
 
         seat_send_changed(s, "Sessions\0");
 
@@ -533,7 +533,7 @@ void seat_add_to_gc_queue(Seat *s) {
         if (s->in_gc_queue)
                 return;
 
-        LIST_PREPEND(Seat, gc_queue, s->manager->seat_gc_queue, s);
+        LIST_PREPEND(gc_queue, s->manager->seat_gc_queue, s);
         s->in_gc_queue = true;
 }
 
diff --git a/src/login/logind-session-device.c b/src/login/logind-session-device.c
index 6605935..f1578bd 100644
--- a/src/login/logind-session-device.c
+++ b/src/login/logind-session-device.c
@@ -390,7 +390,7 @@ int session_device_new(Session *s, dev_t dev, SessionDevice **out) {
         }
         sd->fd = r;
 
-        LIST_PREPEND(SessionDevice, sd_by_device, sd->device->session_devices, sd);
+        LIST_PREPEND(sd_by_device, sd->device->session_devices, sd);
 
         *out = sd;
         return 0;
@@ -409,7 +409,7 @@ void session_device_free(SessionDevice *sd) {
         session_device_notify(sd, SESSION_DEVICE_RELEASE);
         close_nointr_nofail(sd->fd);
 
-        LIST_REMOVE(SessionDevice, sd_by_device, sd->device->session_devices, sd);
+        LIST_REMOVE(sd_by_device, sd->device->session_devices, sd);
 
         hashmap_remove(sd->session->devices, &sd->dev);
 
diff --git a/src/login/logind-session.c b/src/login/logind-session.c
index 27aa335..8a021f3 100644
--- a/src/login/logind-session.c
+++ b/src/login/logind-session.c
@@ -96,7 +96,7 @@ void session_free(Session *s) {
         assert(s);
 
         if (s->in_gc_queue)
-                LIST_REMOVE(Session, gc_queue, s->manager->session_gc_queue, s);
+                LIST_REMOVE(gc_queue, s->manager->session_gc_queue, s);
 
         session_drop_controller(s);
 
@@ -106,7 +106,7 @@ void session_free(Session *s) {
         hashmap_free(s->devices);
 
         if (s->user) {
-                LIST_REMOVE(Session, sessions_by_user, s->user->sessions, s);
+                LIST_REMOVE(sessions_by_user, s->user->sessions, s);
 
                 if (s->user->display == s)
                         s->user->display = NULL;
@@ -118,7 +118,7 @@ void session_free(Session *s) {
                 if (s->seat->pending_switch == s)
                         s->seat->pending_switch = NULL;
 
-                LIST_REMOVE(Session, sessions_by_seat, s->seat->sessions, s);
+                LIST_REMOVE(sessions_by_seat, s->seat->sessions, s);
         }
 
         if (s->scope) {
@@ -149,7 +149,7 @@ void session_set_user(Session *s, User *u) {
         assert(!s->user);
 
         s->user = u;
-        LIST_PREPEND(Session, sessions_by_user, u->sessions, s);
+        LIST_PREPEND(sessions_by_user, u->sessions, s);
 }
 
 int session_save(Session *s) {
@@ -938,7 +938,7 @@ void session_add_to_gc_queue(Session *s) {
         if (s->in_gc_queue)
                 return;
 
-        LIST_PREPEND(Session, gc_queue, s->manager->session_gc_queue, s);
+        LIST_PREPEND(gc_queue, s->manager->session_gc_queue, s);
         s->in_gc_queue = true;
 }
 
diff --git a/src/login/logind-user.c b/src/login/logind-user.c
index adbe638..54ee1cb 100644
--- a/src/login/logind-user.c
+++ b/src/login/logind-user.c
@@ -72,7 +72,7 @@ void user_free(User *u) {
         assert(u);
 
         if (u->in_gc_queue)
-                LIST_REMOVE(User, gc_queue, u->manager->user_gc_queue, u);
+                LIST_REMOVE(gc_queue, u->manager->user_gc_queue, u);
 
         while (u->sessions)
                 session_free(u->sessions);
@@ -644,7 +644,7 @@ void user_add_to_gc_queue(User *u) {
         if (u->in_gc_queue)
                 return;
 
-        LIST_PREPEND(User, gc_queue, u->manager->user_gc_queue, u);
+        LIST_PREPEND(gc_queue, u->manager->user_gc_queue, u);
         u->in_gc_queue = true;
 }
 
diff --git a/src/login/logind.c b/src/login/logind.c
index 0628032..06db2db 100644
--- a/src/login/logind.c
+++ b/src/login/logind.c
@@ -929,7 +929,7 @@ void manager_gc(Manager *m, bool drop_not_started) {
         assert(m);
 
         while ((seat = m->seat_gc_queue)) {
-                LIST_REMOVE(Seat, gc_queue, m->seat_gc_queue, seat);
+                LIST_REMOVE(gc_queue, m->seat_gc_queue, seat);
                 seat->in_gc_queue = false;
 
                 if (seat_check_gc(seat, drop_not_started) == 0) {
@@ -939,7 +939,7 @@ void manager_gc(Manager *m, bool drop_not_started) {
         }
 
         while ((session = m->session_gc_queue)) {
-                LIST_REMOVE(Session, gc_queue, m->session_gc_queue, session);
+                LIST_REMOVE(gc_queue, m->session_gc_queue, session);
                 session->in_gc_queue = false;
 
                 if (session_check_gc(session, drop_not_started) == 0) {
@@ -950,7 +950,7 @@ void manager_gc(Manager *m, bool drop_not_started) {
         }
 
         while ((user = m->user_gc_queue)) {
-                LIST_REMOVE(User, gc_queue, m->user_gc_queue, user);
+                LIST_REMOVE(gc_queue, m->user_gc_queue, user);
                 user->in_gc_queue = false;
 
                 if (user_check_gc(user, drop_not_started) == 0) {
diff --git a/src/machine/machine.c b/src/machine/machine.c
index 602aa18..f78b0cf 100644
--- a/src/machine/machine.c
+++ b/src/machine/machine.c
@@ -73,7 +73,7 @@ void machine_free(Machine *m) {
         assert(m);
 
         if (m->in_gc_queue)
-                LIST_REMOVE(Machine, gc_queue, m->manager->machine_gc_queue, m);
+                LIST_REMOVE(gc_queue, m->manager->machine_gc_queue, m);
 
         if (m->scope) {
                 hashmap_remove(m->manager->machine_units, m->scope);
@@ -369,7 +369,7 @@ void machine_add_to_gc_queue(Machine *m) {
         if (m->in_gc_queue)
                 return;
 
-        LIST_PREPEND(Machine, gc_queue, m->manager->machine_gc_queue, m);
+        LIST_PREPEND(gc_queue, m->manager->machine_gc_queue, m);
         m->in_gc_queue = true;
 }
 
diff --git a/src/machine/machined.c b/src/machine/machined.c
index ad804a1..ca84f8a 100644
--- a/src/machine/machined.c
+++ b/src/machine/machined.c
@@ -249,7 +249,7 @@ void manager_gc(Manager *m, bool drop_not_started) {
         assert(m);
 
         while ((machine = m->machine_gc_queue)) {
-                LIST_REMOVE(Machine, gc_queue, m->machine_gc_queue, machine);
+                LIST_REMOVE(gc_queue, m->machine_gc_queue, machine);
                 machine->in_gc_queue = false;
 
                 if (machine_check_gc(machine, drop_not_started) == 0) {
diff --git a/src/shared/list.h b/src/shared/list.h
index 4767574..e55b91c 100644
--- a/src/shared/list.h
+++ b/src/shared/list.h
@@ -31,23 +31,23 @@
         t *name##_next, *name##_prev
 
 /* Initialize the list's head */
-#define LIST_HEAD_INIT(t,head)                                          \
+#define LIST_HEAD_INIT(head)                                            \
         do {                                                            \
                 (head) = NULL; }                                        \
         while(false)
 
 /* Initialize a list item */
-#define LIST_INIT(t,name,item)                                          \
+#define LIST_INIT(name,item)                                            \
         do {                                                            \
-                t *_item = (item);                                      \
+                typeof(*(item)) *_item = (item);                        \
                 assert(_item);                                          \
                 _item->name##_prev = _item->name##_next = NULL;         \
         } while(false)
 
 /* Prepend an item to the list */
-#define LIST_PREPEND(t,name,head,item)                                  \
+#define LIST_PREPEND(name,head,item)                                    \
         do {                                                            \
-                t **_head = &(head), *_item = (item);                   \
+                typeof(*(head)) **_head = &(head), *_item = (item);     \
                 assert(_item);                                          \
                 if ((_item->name##_next = *_head))                      \
                         _item->name##_next->name##_prev = _item;        \
@@ -56,9 +56,9 @@
         } while(false)
 
 /* Remove an item from the list */
-#define LIST_REMOVE(t,name,head,item)                                   \
+#define LIST_REMOVE(name,head,item)                                     \
         do {                                                            \
-                t **_head = &(head), *_item = (item);                   \
+                typeof(*(head)) **_head = &(head), *_item = (item);     \
                 assert(_item);                                          \
                 if (_item->name##_next)                                 \
                         _item->name##_next->name##_prev = _item->name##_prev; \
@@ -72,9 +72,9 @@
         } while(false)
 
 /* Find the head of the list */
-#define LIST_FIND_HEAD(t,name,item,head)                                \
+#define LIST_FIND_HEAD(name,item,head)                                  \
         do {                                                            \
-                t *_item = (item);                                      \
+                typeof(*(item)) *_item = (item);                        \
                 assert(_item);                                          \
                 while (_item->name##_prev)                              \
                        _item = _item->name##_prev;                      \
@@ -82,9 +82,9 @@
         } while (false)
 
 /* Find the tail of the list */
-#define LIST_FIND_TAIL(t,name,item,tail)                                \
+#define LIST_FIND_TAIL(name,item,tail)                                  \
         do {                                                            \
-                t *_item = (item);                                      \
+                typeof(*(item)) *_item = (item);                        \
                 assert(_item);                                          \
                 while (_item->name##_next)                              \
                         _item = _item->name##_next;                     \
@@ -92,9 +92,9 @@
         } while (false)
 
 /* Insert an item after another one (a = where, b = what) */
-#define LIST_INSERT_AFTER(t,name,head,a,b)                              \
+#define LIST_INSERT_AFTER(name,head,a,b)                                \
         do {                                                            \
-                t **_head = &(head), *_a = (a), *_b = (b);              \
+                typeof(*(head)) **_head = &(head), *_a = (a), *_b = (b); \
                 assert(_b);                                             \
                 if (!_a) {                                              \
                         if ((_b->name##_next = *_head))                 \
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index a8a86ed..d458c65 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -3019,7 +3019,7 @@ static int status_property(const char *name, DBusMessageIter *iter, UnitStatusIn
                                         return r;
                                 }
 
-                                LIST_PREPEND(ExecStatusInfo, exec, i->exec, info);
+                                LIST_PREPEND(exec, i->exec, info);
 
                                 dbus_message_iter_next(&sub);
                         }
@@ -3474,7 +3474,7 @@ static int show_one(const char *verb,
         }
 
         while ((p = info.exec)) {
-                LIST_REMOVE(ExecStatusInfo, exec, info.exec, p);
+                LIST_REMOVE(exec, info.exec, p);
                 exec_status_info_free(p);
         }
 
diff --git a/src/test/test-list.c b/src/test/test-list.c
index 2710504..fa52ad1 100644
--- a/src/test/test-list.c
+++ b/src/test/test-list.c
@@ -29,13 +29,13 @@ int main(int argc, const char *argv[]) {
         list_item items[4];
         list_item *cursor;
 
-        LIST_HEAD_INIT(list_item, head);
+        LIST_HEAD_INIT(head);
         assert_se(head == NULL);
 
         for (i = 0; i < ELEMENTSOF(items); i++) {
-                LIST_INIT(list_item, item, &items[i]);
+                LIST_INIT(item, &items[i]);
                 assert_se(LIST_JUST_US(item, &items[i]));
-                LIST_PREPEND(list_item, item, head, &items[i]);
+                LIST_PREPEND(item, head, &items[i]);
         }
 
         assert_se(!LIST_JUST_US(item, head));
@@ -50,13 +50,13 @@ int main(int argc, const char *argv[]) {
         assert_se(items[2].item_prev == &items[3]);
         assert_se(items[3].item_prev == NULL);
 
-        LIST_FIND_HEAD(list_item, item, &items[0], cursor);
+        LIST_FIND_HEAD(item, &items[0], cursor);
         assert_se(cursor == &items[3]);
 
-        LIST_FIND_TAIL(list_item, item, &items[3], cursor);
+        LIST_FIND_TAIL(item, &items[3], cursor);
         assert_se(cursor == &items[0]);
 
-        LIST_REMOVE(list_item, item, head, &items[1]);
+        LIST_REMOVE(item, head, &items[1]);
         assert_se(LIST_JUST_US(item, &items[1]));
 
         assert_se(items[0].item_next == NULL);
@@ -67,7 +67,7 @@ int main(int argc, const char *argv[]) {
         assert_se(items[2].item_prev == &items[3]);
         assert_se(items[3].item_prev == NULL);
 
-        LIST_INSERT_AFTER(list_item, item, head, &items[3], &items[1]);
+        LIST_INSERT_AFTER(item, head, &items[3], &items[1]);
         assert_se(items[0].item_next == NULL);
         assert_se(items[2].item_next == &items[0]);
         assert_se(items[1].item_next == &items[2]);
@@ -78,7 +78,7 @@ int main(int argc, const char *argv[]) {
         assert_se(items[1].item_prev == &items[3]);
         assert_se(items[3].item_prev == NULL);
 
-        LIST_REMOVE(list_item, item, head, &items[0]);
+        LIST_REMOVE(item, head, &items[0]);
         assert_se(LIST_JUST_US(item, &items[0]));
 
         assert_se(items[2].item_next == NULL);
@@ -89,7 +89,7 @@ int main(int argc, const char *argv[]) {
         assert_se(items[1].item_prev == &items[3]);
         assert_se(items[3].item_prev == NULL);
 
-        LIST_REMOVE(list_item, item, head, &items[1]);
+        LIST_REMOVE(item, head, &items[1]);
         assert_se(LIST_JUST_US(item, &items[1]));
 
         assert_se(items[2].item_next == NULL);
@@ -98,11 +98,11 @@ int main(int argc, const char *argv[]) {
         assert_se(items[2].item_prev == &items[3]);
         assert_se(items[3].item_prev == NULL);
 
-        LIST_REMOVE(list_item, item, head, &items[2]);
+        LIST_REMOVE(item, head, &items[2]);
         assert_se(LIST_JUST_US(item, &items[2]));
         assert_se(LIST_JUST_US(item, head));
 
-        LIST_REMOVE(list_item, item, head, &items[3]);
+        LIST_REMOVE(item, head, &items[3]);
         assert_se(LIST_JUST_US(item, &items[3]));
 
         return 0;

commit 14bf2c9d375db6a4670bc0ef0e521e35a939a498
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Oct 14 04:59:26 2013 +0200

    util: allow trailing semicolons on define_trivial_cleanup_func lines
    
    Emacs C indenting really gets confused by these lines if they carry no
    trailing semicolon, hence let's make this nicer for good old emacs. The
    other macros which define functions already do this too, so let's copy
    the scheme here.
    
    Also, let's use an uppercase name for the macro. So far our rough rule
    was that macros that are totally not function-like (like this ones,
    which define a function) are uppercase. (Well, admittedly it is a rough
    rule only, for example function and variable decorators are all
    lower-case SINCE THE CONSTANT YELLING IN THE SOURCES WOULD SUCK, and
    also they at least got underscore prefixes.) Also, the macros that
    define functions that we already have are all uppercase, so let's do the
    same here...

diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c
index b6f6a74..fae4b71 100644
--- a/src/gpt-auto-generator/gpt-auto-generator.c
+++ b/src/gpt-auto-generator/gpt-auto-generator.c
@@ -54,7 +54,7 @@
 
 static const char *arg_dest = "/tmp";
 
-define_trivial_cleanup_func(blkid_probe, blkid_free_probe)
+DEFINE_TRIVIAL_CLEANUP_FUNC(blkid_probe, blkid_free_probe);
 #define _cleanup_blkid_freep_probe_ _cleanup_(blkid_free_probep)
 
 static int verify_gpt_partition(const char *node, sd_id128_t *type, unsigned *nr, char **fstype) {
diff --git a/src/journal/journal-internal.h b/src/journal/journal-internal.h
index 1bc912c..3355fca 100644
--- a/src/journal/journal-internal.h
+++ b/src/journal/journal-internal.h
@@ -135,7 +135,7 @@ struct sd_journal {
 char *journal_make_match_string(sd_journal *j);
 void journal_print_header(sd_journal *j);
 
-define_trivial_cleanup_func(sd_journal*, sd_journal_close)
+DEFINE_TRIVIAL_CLEANUP_FUNC(sd_journal*, sd_journal_close);
 #define _cleanup_journal_close_ _cleanup_(sd_journal_closep)
 
 #define JOURNAL_FOREACH_DATA_RETVAL(j, data, l, retval)                     \
diff --git a/src/shared/fdset.h b/src/shared/fdset.h
index 6277e46..907acd7 100644
--- a/src/shared/fdset.h
+++ b/src/shared/fdset.h
@@ -49,5 +49,5 @@ int fdset_iterate(FDSet *s, Iterator *i);
 #define FDSET_FOREACH(fd, fds, i) \
         for ((i) = ITERATOR_FIRST, (fd) = fdset_iterate((fds), &(i)); (fd) >= 0; (fd) = fdset_iterate((fds), &(i)))
 
-define_trivial_cleanup_func(FDSet*, fdset_free)
+DEFINE_TRIVIAL_CLEANUP_FUNC(FDSet*, fdset_free);
 #define _cleanup_fdset_free_ _cleanup_(fdset_freep)
diff --git a/src/shared/set.h b/src/shared/set.h
index a291470..5612478 100644
--- a/src/shared/set.h
+++ b/src/shared/set.h
@@ -73,7 +73,7 @@ char **set_get_strv(Set *s);
 #define SET_FOREACH_BACKWARDS(e, s, i) \
         for ((i) = ITERATOR_LAST, (e) = set_iterate_backwards((s), &(i)); (e); (e) = set_iterate_backwards((s), &(i)))
 
-define_trivial_cleanup_func(Set*, set_free)
-define_trivial_cleanup_func(Set*, set_free_free)
+DEFINE_TRIVIAL_CLEANUP_FUNC(Set*, set_free);
+DEFINE_TRIVIAL_CLEANUP_FUNC(Set*, set_free_free);
 #define _cleanup_set_free_ _cleanup_(set_freep)
 #define _cleanup_set_free_free_ _cleanup_(set_free_freep)
diff --git a/src/shared/strv.h b/src/shared/strv.h
index 4d117f8..f6fb033 100644
--- a/src/shared/strv.h
+++ b/src/shared/strv.h
@@ -30,7 +30,7 @@ char *strv_find(char **l, const char *name) _pure_;
 char *strv_find_prefix(char **l, const char *name) _pure_;
 
 void strv_free(char **l);
-define_trivial_cleanup_func(char**, strv_free)
+DEFINE_TRIVIAL_CLEANUP_FUNC(char**, strv_free);
 #define _cleanup_strv_free_ _cleanup_(strv_freep)
 
 char **strv_copy(char * const *l);
diff --git a/src/shared/udev-util.h b/src/shared/udev-util.h
index bff8f5f..27677af 100644
--- a/src/shared/udev-util.h
+++ b/src/shared/udev-util.h
@@ -24,11 +24,11 @@
 #include "udev.h"
 #include "util.h"
 
-define_trivial_cleanup_func(struct udev*, udev_unref)
-define_trivial_cleanup_func(struct udev_device*, udev_device_unref)
-define_trivial_cleanup_func(struct udev_enumerate*, udev_enumerate_unref)
-define_trivial_cleanup_func(struct udev_event*, udev_event_unref)
-define_trivial_cleanup_func(struct udev_rules*, udev_rules_unref)
+DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev*, udev_unref);
+DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_device*, udev_device_unref);
+DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_enumerate*, udev_enumerate_unref);
+DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_event*, udev_event_unref);
+DEFINE_TRIVIAL_CLEANUP_FUNC(struct udev_rules*, udev_rules_unref);
 
 #define _cleanup_udev_unref_ _cleanup_(udev_unrefp)
 #define _cleanup_udev_device_unref_ _cleanup_(udev_device_unrefp)
diff --git a/src/shared/util.h b/src/shared/util.h
index 99a138c..86b2143 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -556,11 +556,12 @@ static inline void freep(void *p) {
         free(*(void**) p);
 }
 
-#define define_trivial_cleanup_func(type, func) \
-        static inline void func##p(type *p) {   \
-        if (*p)                                 \
-                func(*p);                       \
-        }                                       \
+#define DEFINE_TRIVIAL_CLEANUP_FUNC(type, func)                 \
+        static inline void func##p(type *p) {                   \
+                if (*p)                                         \
+                        func(*p);                               \
+        }                                                       \
+        struct __useless_struct_to_allow_trailing_semicolon__
 
 static inline void closep(int *fd) {
         if (*fd >= 0)
@@ -571,10 +572,10 @@ static inline void umaskp(mode_t *u) {
         umask(*u);
 }
 
-define_trivial_cleanup_func(FILE*, fclose)
-define_trivial_cleanup_func(FILE*, pclose)
-define_trivial_cleanup_func(DIR*, closedir)
-define_trivial_cleanup_func(FILE*, endmntent)
+DEFINE_TRIVIAL_CLEANUP_FUNC(FILE*, fclose);
+DEFINE_TRIVIAL_CLEANUP_FUNC(FILE*, pclose);
+DEFINE_TRIVIAL_CLEANUP_FUNC(DIR*, closedir);
+DEFINE_TRIVIAL_CLEANUP_FUNC(FILE*, endmntent);
 
 #define _cleanup_free_ _cleanup_(freep)
 #define _cleanup_close_ _cleanup_(closep)
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index 42cc34d..3cc831a 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -995,7 +995,7 @@ static void item_free(Item *i) {
         free(i);
 }
 
-define_trivial_cleanup_func(Item*, item_free)
+DEFINE_TRIVIAL_CLEANUP_FUNC(Item*, item_free);
 #define _cleanup_item_free_ _cleanup_(item_freep)
 
 static bool item_equal(Item *a, Item *b) {

commit 416446221d905b6815175dc4d525d27f8ae43d1b
Author: Lennart Poettering <lennart at poettering.net>
Date:   Mon Oct 14 04:52:51 2013 +0200

    update TODO

diff --git a/TODO b/TODO
index 955241a..66cd5b4 100644
--- a/TODO
+++ b/TODO
@@ -48,6 +48,12 @@ CGroup Rework Completion:
 
 Features:
 
+* "systemctl cat" or "systemctl view" command or or so, that cats the backing unit file of a service, plus its drop-ins and shows them in a pager
+
+* rfkill,backlight: we probably should use a path ID of some kind rather than the sysname as file name to store status in
+
+* rfkill,backlight: we probably should run the load tools inside of the udev rules so that the state is properly initialized by the time other software sees it
+
 * Add a new Distribute=$NUMBER key to socket units that makes use of SO_REUSEPORT to distribute network traffic on $NUMBER instances
 
 * tmpfiles: when applying ownership to /run/log/journal also do this for the journal fails contained in it
@@ -70,17 +76,6 @@ Features:
   service is not cleaned up again when it has StopWhenUnneeded=yes
   http://lists.freedesktop.org/archives/systemd-devel/2013-July/012141.html
 
-* backlight: properly handle multiple backlight devices for the same
-  hardware: at shutdown we should only save the backlight setting for
-  the "best" way to access the backlight. Strategy should be: at
-  shutdown, ignore all backlights that are connected to a non-eDP or
-  non-LVDS port, and then prefer the firmware device over platform
-  device over raw device per-PCI card. Delete all old data. At boot
-  simply apply whatever data we find. Also see
-  http://cgit.freedesktop.org/libbacklight/tree/libbacklight.c#n194
-
-* rfkill: save/restore soft rfkill status across reboots
-
 * refuse boot if /etc/os-release is missing or /etc/machine-id cannot be set up
 
 * ensure scope units may be started only a single time



More information about the systemd-commits mailing list