From d0031f22cfecc2cce512aae66bedc9fe337f5d97 Mon Sep 17 00:00:00 2001 From: Felix Kuehling Date: Sat, 21 Feb 2004 19:54:51 +0000 Subject: Conditionally add definition of list_for_each_entry_safe for kernel versions that don't have it. --- linux/drmP.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'linux') diff --git a/linux/drmP.h b/linux/drmP.h index 742c4ac58..503d6c1b3 100644 --- a/linux/drmP.h +++ b/linux/drmP.h @@ -202,6 +202,14 @@ prefetch(pos->member.next)) #endif +#ifndef list_for_each_entry_safe +#define list_for_each_entry_safe(pos, n, head, member) \ + for (pos = list_entry((head)->next, typeof(*pos), member), \ + n = list_entry(pos->member.next, typeof(*pos), member); \ + &pos->member != (head); \ + pos = n, n = list_entry(n->member.next, typeof(*n), member)) +#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,19) static inline struct page * vmalloc_to_page(void * vmalloc_addr) { -- cgit v1.2.3