chiark / gitweb /
collect, keymap, systemctl: use _noreturn_
[elogind.git] / src / udev / collect / collect.c
index 882564a5f52bb58310933fb37b21c64d934ff873..80f464aff0040d9e67a34419a2445a8072e70882 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "libudev.h"
 #include "libudev-private.h"
+#include "macro.h"
 
 #define BUFSIZE                        16
 #define UDEV_ALARM_TIMEOUT        180
@@ -55,16 +56,12 @@ static int debug;
 /* 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)
+_noreturn_ static void sig_alrm(int signo)
 {
         exit(4);
 }