Add "const" qualifier to first arg of list_splice()
PATCH 1/1 Add "const" qualifier to first arg of list_splice()
Since neither the list_splice() nor __list_splice() routines modify their first argument, might as well declare them "const".
Signed-off-by Robert P. J. Day <[email protected]>
---
compile-tested on x86 with "make defconfig".
include/linux/list.h +2 -2
@@ -319,7 +319,7 @@ static inline int list_empty_careful(const struct list_head *head)return (next = 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;
@@ -338,7 +338,7 @@ 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);
====================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
Have classroom, will lecture.
http://crashcourse.ca Waterloo, Ontario, CANADA
====================================