mirror of
https://github.com/X11Libre/xf86-video-intel.git
synced 2026-03-24 01:24:12 +00:00
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:
@@ -110,8 +110,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); \
|
||||
|
||||
@@ -305,8 +305,11 @@ list_is_empty(const struct list *head)
|
||||
#define list_last_entry(ptr, type, member) \
|
||||
list_entry((ptr)->prev, type, member)
|
||||
|
||||
#ifndef __container_of
|
||||
#define __container_of(ptr, sample, member) \
|
||||
(void *)((char *)(ptr) - ((char *)&(sample)->member - (char *)(sample)))
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Loop through the list given by head and set pos to struct in the list.
|
||||
*
|
||||
|
||||
@@ -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); \
|
||||
|
||||
Reference in New Issue
Block a user