Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\list_sort.c Create Date:2022-07-28 06:20:49
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Returns a list organized in an intermediate format suited* to chaining of merge() calls: null-terminated, no reserved or* sentinel head node, "prev" links not maintained.

Proto:__attribute__((nonnull(2, 3, 4))) static struct list_head *merge(void *priv, cmp_func cmp, struct list_head *a, struct list_head *b)

Type:struct list_head

Parameter:

TypeParameterName
void *priv
cmp_funccmp
struct list_head *a
struct list_head *b
22  tail = head
24  cycle
26  If cmp(priv, a, b) <= 0 Then
27  tail = a
28  tail = next
29  a = next
30  If Not a Then
31  tail = b
32  Break
34  Else
35  tail = b
36  tail = next
37  b = next
38  If Not b Then
39  tail = a
40  Break
44  Return head
Caller
NameDescribe
list_sortlist_sort - sort a list*@priv: private data, opaque to list_sort(), passed to @cmp*@head: the list to sort*@cmp: the elements comparison function* The comparison funtion @cmp must return > 0 if @a should sort after*@b ("@a > @b" if you want an ascending