diff options
Diffstat (limited to 'src/libudev')
-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) |