[PATCH] Add "const" qualifier to first arg of list_splice() operations.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <rpjday@xxxxxxxxxxxxxx>

---

  compile-tested on x86 with "make defconfig".

diff --git a/include/linux/list.h b/include/linux/list.h
index 75ce2cb..57ad73e 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -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
========================================================================
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux