[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <874om7a01z.fsf@gmail.com>
Date: Wed, 27 Jan 2010 10:13:12 -0800
From: Don Mullis <don.mullis@...il.com>
To: linux-kernel@...r.kernel.org
Cc: airlied@...hat.com, andi@...stfloor.org, david@...morbit.com,
dedekind@...radead.org
Subject: [PATCH v2 2/3] lib: Revise list_sort() header comment
Clarify and correct header comment of list_sort().
Signed-off-by: Don Mullis <don.mullis@...il.com>
Cc: Dave Airlie <airlied@...hat.com>
Cc: Andi Kleen <andi@...stfloor.org>
Cc: Dave Chinner <david@...morbit.com>
Cc: Artem Bityutskiy <dedekind@...radead.org>
---
lib/list_sort.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
Index: linux-2.6/lib/list_sort.c
===================================================================
--- linux-2.6.orig/lib/list_sort.c 2010-01-26 20:01:55.000000000 -0800
+++ linux-2.6/lib/list_sort.c 2010-01-26 20:05:11.000000000 -0800
@@ -81,17 +81,18 @@ static void merge_and_restore_back_links
}
/**
- * list_sort - sort a list.
- * @priv: private data, passed to @cmp
+ * list_sort - sort a list
+ * @priv: private data, opaque to list_sort(), passed to @cmp
* @head: the list to sort
* @cmp: the elements comparison function
*
- * This function implements "merge sort" which has O(nlog(n)) complexity.
- * The list is sorted in ascending order.
+ * This function implements "merge sort", which has O(nlog(n))
+ * complexity.
*
- * The comparison function @cmp is supposed to return a negative value if @a is
- * less than @b, and a positive value if @a is greater than @b. If @a and @b
- * are equivalent, then it does not matter what this function returns.
+ * The comparison function @cmp must return a negative value if @a
+ * should sort before @b, and a positive value if @a should sort after
+ * @b. If @a and @b are equivalent, and their original relative
+ * ordering is to be preserved, @cmp must return 0.
*/
void list_sort(void *priv, struct list_head *head,
int (*cmp)(void *priv, struct list_head *a,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists