]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/list.h
keys: allow clients to set key perms in key_create_or_update()
[linux-2.6-omap-h63xx.git] / include / linux / list.h
index dac16f99c70115ba4e4f1cee8b18f5f1b0f050c8..7627508f1b741aed30ef52ce76c40d2cc8a0646a 100644 (file)
@@ -319,7 +319,16 @@ 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,
+/**
+ * list_is_singular - tests whether a list has just one entry.
+ * @head: the list to test.
+ */
+static inline int list_is_singular(const struct list_head *head)
+{
+       return !list_empty(head) && (head->next == head->prev);
+}
+
+static inline void __list_splice(const struct list_head *list,
                                 struct list_head *head)
 {
        struct list_head *first = list->next;
@@ -338,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);