Skip to content

Commit

Permalink
lists: add "const" qualifier to first arg of list_splice() operations
Browse files Browse the repository at this point in the history
Since neither the list_splice() nor __list_splice() routines modify their
first argument, might as well declare them "const".

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Robert P. J. Day authored and Linus Torvalds committed Apr 29, 2008
1 parent 8673511 commit 95d8c36
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions include/linux/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ static inline int list_is_singular(const struct list_head *head)
return !list_empty(head) && (head->next == head->prev);
}

static inline void __list_splice(struct list_head *list,
static inline void __list_splice(const struct list_head *list,
struct list_head *head)
{
struct list_head *first = list->next;
Expand All @@ -347,7 +347,8 @@ static inline void __list_splice(struct list_head *list,
* @list: the new list to add.
* @head: the place to add it in the first list.
*/
static inline void list_splice(struct list_head *list, struct list_head *head)
static inline void list_splice(const struct list_head *list,
struct list_head *head)
{
if (!list_empty(list))
__list_splice(list, head);
Expand Down

0 comments on commit 95d8c36

Please sign in to comment.