Lines Matching +full:in0 +full:- +full:in1

1 // SPDX-License-Identifier: GPL-2.0
17 /* Size of each of the NULL-terminated input arrays */
19 /* Expected number of non-NULL elements in the output array */
20 #define EXPECT (INPUT_MAX * 2 - 2)
24 struct test_struct **in0, **in1, **out, **p; in test_memcat_p_init() local
25 int err = -ENOMEM, i, r, total = 0; in test_memcat_p_init()
27 in0 = kcalloc(INPUT_MAX, sizeof(*in0), GFP_KERNEL); in test_memcat_p_init()
28 if (!in0) in test_memcat_p_init()
31 in1 = kcalloc(INPUT_MAX, sizeof(*in1), GFP_KERNEL); in test_memcat_p_init()
32 if (!in1) in test_memcat_p_init()
35 for (i = 0, r = 1; i < INPUT_MAX - 1; i++) { in test_memcat_p_init()
36 in0[i] = kmalloc(sizeof(**in0), GFP_KERNEL); in test_memcat_p_init()
37 if (!in0[i]) in test_memcat_p_init()
40 in1[i] = kmalloc(sizeof(**in1), GFP_KERNEL); in test_memcat_p_init()
41 if (!in1[i]) { in test_memcat_p_init()
42 kfree(in0[i]); in test_memcat_p_init()
48 in0[i]->num = r; in test_memcat_p_init()
49 in1[i]->num = -r; in test_memcat_p_init()
50 in0[i]->magic = MAGIC; in test_memcat_p_init()
51 in1[i]->magic = MAGIC; in test_memcat_p_init()
54 in0[i] = in1[i] = NULL; in test_memcat_p_init()
56 out = memcat_p(in0, in1); in test_memcat_p_init()
60 err = -EINVAL; in test_memcat_p_init()
61 for (i = 0, p = out; *p && (i < INPUT_MAX * 2 - 1); p++, i++) { in test_memcat_p_init()
62 total += (*p)->num; in test_memcat_p_init()
64 if ((*p)->magic != MAGIC) { in test_memcat_p_init()
66 (*p)->magic); in test_memcat_p_init()
82 for (i = 0; i < INPUT_MAX - 1; i++) in test_memcat_p_init()
83 if (out[i] != in0[i] || out[i + INPUT_MAX - 1] != in1[i]) { in test_memcat_p_init()
96 for (i--; i >= 0; i--) { in test_memcat_p_init()
97 kfree(in1[i]); in test_memcat_p_init()
98 kfree(in0[i]); in test_memcat_p_init()
101 kfree(in1); in test_memcat_p_init()
103 kfree(in0); in test_memcat_p_init()