aboutsummaryrefslogtreecommitdiff
path: root/lib/list_sort.c
diff options
context:
space:
mode:
authorDon Mullis <don.mullis@gmail.com>2010-03-05 13:43:15 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-06 11:26:35 -0800
commit02b12b7a28faa2e9ed5a361cd08ea576ab1f1509 (patch)
tree3a23cbc81230b478d76d934d5396df097888210d /lib/list_sort.c
parent835cc0c8477fdbc59e0217891d6f11061b1ac4e2 (diff)
lib: revise list_sort() header comment
Clarify and correct header comment of list_sort(). Signed-off-by: Don Mullis <don.mullis@gmail.com> Cc: Dave Airlie <airlied@redhat.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Dave Chinner <david@fromorbit.com> Cc: Artem Bityutskiy <dedekind@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib/list_sort.c')
-rw-r--r--lib/list_sort.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/list_sort.c b/lib/list_sort.c
index 362c10f1653..4b5cb794c38 100644
--- a/lib/list_sort.c
+++ b/lib/list_sort.c
@@ -81,17 +81,18 @@ static void merge_and_restore_back_links(void *priv,
}
/**
- * 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,