Change the variable "new" to "_new" in order to include it from C++ code.
The define "container_of" will cast pointer before assigning. Compilers with stricter options require this. (Andreas Eversberg)
This commit is contained in:
parent
ff117a8d11
commit
be68f6fc6c
|
@ -18,8 +18,8 @@ static inline void prefetch(const void *x) {;}
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#define container_of(ptr, type, member) ({ \
|
#define container_of(ptr, type, member) ({ \
|
||||||
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
|
const typeof( ((type *)0)->member ) *__mptr = (typeof( ((type *)0)->member ) *)(ptr); \
|
||||||
(type *)( (char *)__mptr - offsetof(type,member) );})
|
(type *)( (char *)__mptr - offsetof(type, member) );})
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -59,14 +59,14 @@ struct llist_head {
|
||||||
* This is only for internal llist manipulation where we know
|
* This is only for internal llist manipulation where we know
|
||||||
* the prev/next entries already!
|
* the prev/next entries already!
|
||||||
*/
|
*/
|
||||||
static inline void __llist_add(struct llist_head *new,
|
static inline void __llist_add(struct llist_head *_new,
|
||||||
struct llist_head *prev,
|
struct llist_head *prev,
|
||||||
struct llist_head *next)
|
struct llist_head *next)
|
||||||
{
|
{
|
||||||
next->prev = new;
|
next->prev = _new;
|
||||||
new->next = next;
|
_new->next = next;
|
||||||
new->prev = prev;
|
_new->prev = prev;
|
||||||
prev->next = new;
|
prev->next = _new;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -77,9 +77,9 @@ static inline void __llist_add(struct llist_head *new,
|
||||||
* Insert a new entry after the specified head.
|
* Insert a new entry after the specified head.
|
||||||
* This is good for implementing stacks.
|
* This is good for implementing stacks.
|
||||||
*/
|
*/
|
||||||
static inline void llist_add(struct llist_head *new, struct llist_head *head)
|
static inline void llist_add(struct llist_head *_new, struct llist_head *head)
|
||||||
{
|
{
|
||||||
__llist_add(new, head, head->next);
|
__llist_add(_new, head, head->next);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -90,9 +90,9 @@ static inline void llist_add(struct llist_head *new, struct llist_head *head)
|
||||||
* Insert a new entry before the specified head.
|
* Insert a new entry before the specified head.
|
||||||
* This is useful for implementing queues.
|
* This is useful for implementing queues.
|
||||||
*/
|
*/
|
||||||
static inline void llist_add_tail(struct llist_head *new, struct llist_head *head)
|
static inline void llist_add_tail(struct llist_head *_new, struct llist_head *head)
|
||||||
{
|
{
|
||||||
__llist_add(new, head->prev, head);
|
__llist_add(_new, head->prev, head);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -117,8 +117,8 @@ static inline void __llist_del(struct llist_head * prev, struct llist_head * nex
|
||||||
static inline void llist_del(struct llist_head *entry)
|
static inline void llist_del(struct llist_head *entry)
|
||||||
{
|
{
|
||||||
__llist_del(entry->prev, entry->next);
|
__llist_del(entry->prev, entry->next);
|
||||||
entry->next = LLIST_POISON1;
|
entry->next = (struct llist_head *)LLIST_POISON1;
|
||||||
entry->prev = LLIST_POISON2;
|
entry->prev = (struct llist_head *)LLIST_POISON2;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue