Define __container_of only if not defined yet.

Silence warnings.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult
2024-06-27 13:54:10 +02:00
parent 7f83eb6586
commit 5b60b8c27b
3 changed files with 7 additions and 0 deletions

View File

@@ -108,8 +108,10 @@ list_move(struct list *list, struct list *head)
}
}
#ifndef __container_of
#define __container_of(ptr, sample, member) \
(void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
#endif
#define list_for_each_entry(pos, head, member) \
for (pos = __container_of((head)->next, pos, member); \