chiark / gitweb /
udev: use container_of() macro
[elogind.git] / src / udev / collect / collect.c
index 882564a5f52bb58310933fb37b21c64d934ff873..777542979a174ab37f7bb696d190b4c9dbb78b98 100644 (file)
@@ -55,13 +55,9 @@ static int debug;
 /* This can increase dynamically */
 static size_t bufsize = BUFSIZE;
 
 /* This can increase dynamically */
 static size_t bufsize = BUFSIZE;
 
-static struct _mate *node_to_mate(struct udev_list_node *node)
+static inline struct _mate *node_to_mate(struct udev_list_node *node)
 {
 {
-        char *mate;
-
-        mate = (char *)node;
-        mate -= offsetof(struct _mate, node);
-        return (struct _mate *)mate;
+        return container_of(node, struct _mate, node);
 }
 
 static void sig_alrm(int signo)
 }
 
 static void sig_alrm(int signo)