summaryrefslogtreecommitdiffstats
path: root/src/libudev/libudev-list.c
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@profusion.mobi>2012-04-26 18:36:02 +0200
committerKay Sievers <kay@vrfy.org>2012-04-29 19:15:08 +0200
commitb27ee00bf5e377a4b59b454c68c8617ea9666bc8 (patch)
treec4305be00b117607bdc0561d2a97dadc204107bb /src/libudev/libudev-list.c
parentutil: introduce container_of() macro (diff)
downloadsystemd-b27ee00bf5e377a4b59b454c68c8617ea9666bc8.tar.xz
systemd-b27ee00bf5e377a4b59b454c68c8617ea9666bc8.zip
udev: use container_of() macro
Diffstat (limited to 'src/libudev/libudev-list.c')
-rw-r--r--src/libudev/libudev-list.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/libudev/libudev-list.c b/src/libudev/libudev-list.c
index 1fe46f3f28..aec334bcfc 100644
--- a/src/libudev/libudev-list.c
+++ b/src/libudev/libudev-list.c
@@ -80,13 +80,9 @@ void udev_list_node_remove(struct udev_list_node *entry)
}
/* return list entry which embeds this node */
-static struct udev_list_entry *list_node_to_entry(struct udev_list_node *node)
+static inline struct udev_list_entry *list_node_to_entry(struct udev_list_node *node)
{
- char *list;
-
- list = (char *)node;
- list -= offsetof(struct udev_list_entry, node);
- return (struct udev_list_entry *)list;
+ return container_of(node, struct udev_list_entry, node);
}
void udev_list_init(struct udev *udev, struct udev_list *list, bool unique)