OSDN Git Service

[FreeBSD] Fix linux list compat list_for_each_safe()
authorRobert Noland <rnoland@2hip.net>
Fri, 10 Oct 2008 02:13:26 +0000 (22:13 -0400)
committerRobert Noland <rnoland@2hip.net>
Fri, 10 Oct 2008 02:13:26 +0000 (22:13 -0400)
linux_for_each_safe would not handle lists with a single entry.

bsd-core/drm_linux_list.h

index c9f1b3e..7c6a447 100644 (file)
@@ -66,6 +66,6 @@ list_del(struct list_head *entry) {
 
 #define list_for_each_safe(entry, temp, head)                  \
     for (entry = (head)->next, temp = (entry)->next;           \
-       temp != head;                                           \
-       entry = temp, temp = temp->next)
+       entry != head;                                          \
+       entry = temp, temp = entry->next)