list.h: rename parameter named "new" to "_new" to avoid using a reserved C++ keyword (patch by Arthur Davis)
This commit is contained in:
parent
51711be625
commit
01c6f73ed7
1 changed files with 19 additions and 19 deletions
38
list.h
38
list.h
|
@ -46,41 +46,41 @@ static inline void INIT_LIST_HEAD(struct list_head *list)
|
||||||
* This is only for internal list manipulation where we know
|
* This is only for internal list manipulation where we know
|
||||||
* the prev/next entries already!
|
* 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 *prev,
|
||||||
struct list_head *next)
|
struct list_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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* list_add - add a new entry
|
* list_add - add a new entry
|
||||||
* @new: new entry to be added
|
* @_new: new entry to be added
|
||||||
* @head: list head to add it after
|
* @head: list head to add it after
|
||||||
*
|
*
|
||||||
* 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 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);
|
__list_add(_new, head, head->next);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* list_add_tail - add a new entry
|
* list_add_tail - add a new entry
|
||||||
* @new: new entry to be added
|
* @_new: new entry to be added
|
||||||
* @head: list head to add it before
|
* @head: list head to add it before
|
||||||
*
|
*
|
||||||
* 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 list_add_tail(struct list_head *new, struct list_head *head)
|
static inline void list_add_tail(struct list_head *_new, struct list_head *head)
|
||||||
{
|
{
|
||||||
__list_add(new, head->prev, head);
|
__list_add(_new, head->prev, head);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -113,23 +113,23 @@ static inline void list_del(struct list_head *entry)
|
||||||
/**
|
/**
|
||||||
* list_replace - replace old entry by new one
|
* list_replace - replace old entry by new one
|
||||||
* @old : the element to be replaced
|
* @old : the element to be replaced
|
||||||
* @new : the new element to insert
|
* @_new : the new element to insert
|
||||||
*
|
*
|
||||||
* If @old was empty, it will be overwritten.
|
* If @old was empty, it will be overwritten.
|
||||||
*/
|
*/
|
||||||
static inline void list_replace(struct list_head *old,
|
static inline void list_replace(struct list_head *old,
|
||||||
struct list_head *new)
|
struct list_head *_new)
|
||||||
{
|
{
|
||||||
new->next = old->next;
|
_new->next = old->next;
|
||||||
new->next->prev = new;
|
_new->next->prev = _new;
|
||||||
new->prev = old->prev;
|
_new->prev = old->prev;
|
||||||
new->prev->next = new;
|
_new->prev->next = _new;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void list_replace_init(struct list_head *old,
|
static inline void list_replace_init(struct list_head *old,
|
||||||
struct list_head *new)
|
struct list_head *_new)
|
||||||
{
|
{
|
||||||
list_replace(old, new);
|
list_replace(old, _new);
|
||||||
INIT_LIST_HEAD(old);
|
INIT_LIST_HEAD(old);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue