Lines Matching refs:param
25 static void free_parameter(struct parameter *param) in free_parameter() argument
27 free(param); in free_parameter()
32 struct parameter *param; in alloc_parameter() local
34 param = calloc(1, sizeof(struct parameter)); in alloc_parameter()
35 if (!param) { in alloc_parameter()
40 return param; in alloc_parameter()
117 static void free_parameter(struct parameter *param) in free_parameter() argument
119 unsigned int allocation_index = param - params; in free_parameter()
121 if (param == NULL) { in free_parameter()
125 "param %p given to free is not in the static buffer %p:%u", param, params, in free_parameter()
133 struct parameter *param; in alloc_parameter() local
142 param = params + allocation_index; in alloc_parameter()
143 (void)memset(param, 0, sizeof(*param)); in alloc_parameter()
144 return param; in alloc_parameter()
153 static struct parameter *find_and_delete_value(struct parameter *param, const char *fn, in find_and_delete_value() argument
158 if (!param->next) { in find_and_delete_value()
162 if (strcmp(param->next->name, name) || strcmp(param->next->fn, fn)) { in find_and_delete_value()
163 return find_and_delete_value(param->next, fn, name); in find_and_delete_value()
166 value = param->next; in find_and_delete_value()
167 param->next = param->next->next; in find_and_delete_value()
173 static void insert_value(struct parameter *param, const char *fn, const char *name, uintptr_t val) in insert_value() argument
183 while (param->next) { in insert_value()
184 param = param->next; in insert_value()
188 value->next = param->next; in insert_value()
189 param->next = value; in insert_value()
202 struct parameter *param; in z_ztest_check_expected_value() local
205 param = find_and_delete_value(¶meter_list, fn, name); in z_ztest_check_expected_value()
206 if (!param) { in z_ztest_check_expected_value()
211 expected = param->value; in z_ztest_check_expected_value()
212 free_parameter(param); in z_ztest_check_expected_value()
231 struct parameter *param; in z_ztest_check_expected_data() local
234 param = find_and_delete_value(¶meter_list, fn, name); in z_ztest_check_expected_data()
235 if (!param) { in z_ztest_check_expected_data()
245 expected = (void *)param->value; in z_ztest_check_expected_data()
246 free_parameter(param); in z_ztest_check_expected_data()
269 struct parameter *param; in z_ztest_copy_return_data() local
278 param = find_and_delete_value(¶meter_list, fn, name); in z_ztest_copy_return_data()
279 if (!param) { in z_ztest_copy_return_data()
284 return_data = (void *)param->value; in z_ztest_copy_return_data()
285 free_parameter(param); in z_ztest_copy_return_data()
298 struct parameter *param = find_and_delete_value(&return_value_list, fn, ""); in z_ztest_get_return_value() local
300 if (!param) { in z_ztest_get_return_value()
305 value = param->value; in z_ztest_get_return_value()
306 free_parameter(param); in z_ztest_get_return_value()
311 static void free_param_list(struct parameter *param) in free_param_list() argument
315 while (param) { in free_param_list()
316 next = param->next; in free_param_list()
317 free_parameter(param); in free_param_list()
318 param = next; in free_param_list()