filter_chain: use container_of()
authorRémi Denis-Courmont <remi@remlab.net>
Wed, 26 Jul 2017 18:04:47 +0000 (21:04 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Wed, 26 Jul 2017 18:05:09 +0000 (21:05 +0300)
src/misc/filter_chain.c

index 02e389d..1b93ddc 100644 (file)
@@ -43,9 +43,9 @@ typedef struct chained_filter_t
 } chained_filter_t;
 
 /* Only use this with filter objects from _this_ C module */
-static inline chained_filter_t *chained (filter_t *filter)
+static inline chained_filter_t *chained(filter_t *filter)
 {
-    return (chained_filter_t *)filter;
+    return container_of(filter, chained_filter_t, filter);
 }
 
 /* */