summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--util_double_list.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/util_double_list.h b/util_double_list.h
index 5d01f52d..7e48b26c 100644
--- a/util_double_list.h
+++ b/util_double_list.h
@@ -110,7 +110,7 @@ static inline void list_delinit(struct list_head *item)
#ifndef container_of
#define container_of(ptr, sample, member) \
(void *)((char *)(ptr) \
- - ((char *)&(sample)->member - (char *)(sample)))
+ - ((char *)&((typeof(sample))0)->member))
#endif
#define LIST_FOR_EACH_ENTRY(pos, head, member) \