summaryrefslogtreecommitdiff
path: root/base/data-struct/list.h
diff options
context:
space:
mode:
Diffstat (limited to 'base/data-struct/list.h')
-rw-r--r--base/data-struct/list.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/base/data-struct/list.h b/base/data-struct/list.h
index 54cb1c10b..e0a6256a4 100644
--- a/base/data-struct/list.h
+++ b/base/data-struct/list.h
@@ -1,7 +1,7 @@
#ifndef BASE_DATA_STRUCT_LIST_H
#define BASE_DATA_STRUCT_LIST_H
-#include <stddef.h> /* offsetof */
+#include "base/memory/container_of.h"
//----------------------------------------------------------------
@@ -100,7 +100,7 @@ struct dm_list *dm_list_next(const struct dm_list *head, const struct dm_list *e
* contained in a structure of type t, return the containing structure.
*/
#define dm_list_struct_base(v, t, head) \
- ((t *)((const char *)(v) - offsetof(t, head)))
+ container_of(v, t, head)
/*
* Given the address v of an instance of 'struct dm_list list' contained in