diff options
Diffstat (limited to 'include/linux/list.h')
-rw-r--r-- | include/linux/list.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/include/linux/list.h b/include/linux/list.h index 00b879310..e77559a68 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -1,6 +1,8 @@ #ifndef _LINUX_LIST_H #define _LINUX_LIST_H +#ifdef __KERNEL__ + /* * Simple doubly linked list implementation. * @@ -28,7 +30,7 @@ struct list_head { * This is only for internal list manipulation where we know * the prev/next entries already! */ -static inline void __list_add(struct list_head * new, +static __inline__ void __list_add(struct list_head * new, struct list_head * prev, struct list_head * next) { @@ -41,7 +43,7 @@ static inline void __list_add(struct list_head * new, /* * Insert a new entry after the specified head.. */ -static inline void list_add(struct list_head *new, struct list_head *head) +static __inline__ void list_add(struct list_head *new, struct list_head *head) { __list_add(new, head, head->next); } @@ -53,18 +55,19 @@ static inline void list_add(struct list_head *new, struct list_head *head) * This is only for internal list manipulation where we know * the prev/next entries already! */ -static inline void __list_del(struct list_head * prev, struct list_head * next) +static __inline__ void __list_del(struct list_head * prev, + struct list_head * next) { next->prev = prev; prev->next = next; } -static inline void list_del(struct list_head *entry) +static __inline__ void list_del(struct list_head *entry) { __list_del(entry->prev, entry->next); } -static inline int list_empty(struct list_head *head) +static __inline__ int list_empty(struct list_head *head) { return head->next == head; } @@ -72,7 +75,7 @@ static inline int list_empty(struct list_head *head) /* * Splice in "list" into "head" */ -static inline void list_splice(struct list_head *list, struct list_head *head) +static __inline__ void list_splice(struct list_head *list, struct list_head *head) { struct list_head *first = list->next; @@ -91,4 +94,6 @@ static inline void list_splice(struct list_head *list, struct list_head *head) #define list_entry(ptr, type, member) \ ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member))) +#endif /* __KERNEL__ */ + #endif |