From 3058112a6a72568c85ce9a6c637c9580e36dfd91 Mon Sep 17 00:00:00 2001 From: Don Mullis Date: Fri, 5 Mar 2010 13:43:15 -0800 Subject: [PATCH] --- yaml --- r: 186270 b: refs/heads/master c: 02b12b7a28faa2e9ed5a361cd08ea576ab1f1509 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/lib/list_sort.c | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 797f59e3f277..2fd12b1e37b2 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 835cc0c8477fdbc59e0217891d6f11061b1ac4e2 +refs/heads/master: 02b12b7a28faa2e9ed5a361cd08ea576ab1f1509 diff --git a/trunk/lib/list_sort.c b/trunk/lib/list_sort.c index 362c10f1653f..4b5cb794c38b 100644 --- a/trunk/lib/list_sort.c +++ b/trunk/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,