Lines Matching refs:cmp
13 static struct list_head *merge(void *priv, list_cmp_func_t cmp,
20 if (cmp(priv, a, b) <= 0) {
49 static void merge_final(void *priv, list_cmp_func_t cmp, struct list_head *head,
57 if (cmp(priv, a, b) <= 0) {
83 * element comparison is needed, so the client's cmp()
87 cmp(priv, b, b);
100 * @priv: private data, opaque to list_sort(), passed to @cmp
102 * @cmp: the elements comparison function
104 * The comparison function @cmp must return > 0 if @a should sort after
113 * - Antisymmetry: cmp(@a, @b) must return the opposite sign of
114 * cmp(@b, @a).
115 * - Transitivity: if cmp(@a, @b) <= 0 and cmp(@b, @c) <= 0, then
116 * cmp(@a, @c) <= 0.
118 * This is compatible with two styles of @cmp function:
189 void list_sort(void *priv, struct list_head *head, list_cmp_func_t cmp)
229 a = merge(priv, cmp, b, a);
251 list = merge(priv, cmp, pending, list);
255 merge_final(priv, cmp, head, pending, list);