diff options
author | Lucas De Marchi <lucas.demarchi@profusion.mobi> | 2012-04-26 18:36:02 +0200 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2012-04-29 19:15:08 +0200 |
commit | b27ee00bf5e377a4b59b454c68c8617ea9666bc8 (patch) | |
tree | c4305be00b117607bdc0561d2a97dadc204107bb /src/libudev/libudev-list.c | |
parent | util: introduce container_of() macro (diff) | |
download | systemd-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.c | 8 |
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) |