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>
This commit is contained in:
Don Mullis 2010-03-05 13:43:15 -08:00 committed by Linus Torvalds
parent 835cc0c847
commit 02b12b7a28

View File

@ -81,17 +81,18 @@ static void merge_and_restore_back_links(void *priv,
} }
/** /**
* list_sort - sort a list. * list_sort - sort a list
* @priv: private data, passed to @cmp * @priv: private data, opaque to list_sort(), passed to @cmp
* @head: the list to sort * @head: the list to sort
* @cmp: the elements comparison function * @cmp: the elements comparison function
* *
* This function implements "merge sort" which has O(nlog(n)) complexity. * This function implements "merge sort", which has O(nlog(n))
* The list is sorted in ascending order. * complexity.
* *
* The comparison function @cmp is supposed to return a negative value if @a is * The comparison function @cmp must return a negative value if @a
* less than @b, and a positive value if @a is greater than @b. If @a and @b * should sort before @b, and a positive value if @a should sort after
* are equivalent, then it does not matter what this function returns. * @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, void list_sort(void *priv, struct list_head *head,
int (*cmp)(void *priv, struct list_head *a, int (*cmp)(void *priv, struct list_head *a,