Lines Matching refs:input

40 	int (*filter)(void *attr, const char *input, int *err);
90 static int int_filter(long val, const char *op, int input, int *err) in int_filter() argument
93 return (val <= input); in int_filter()
95 return (val >= input); in int_filter()
97 return (val != input); in int_filter()
99 return (val > input); in int_filter()
101 return (val < input); in int_filter()
103 return (val == input); in int_filter()
114 static int attr_enum_filter(void *attr, const char *input, int *err, in attr_enum_filter() argument
121 for (i = 0; input[i]; i++) { in attr_enum_filter()
122 if (!strchr(op_list, input[i])) { in attr_enum_filter()
123 input_val = input + i; in attr_enum_filter()
130 pr_err("kunit executor: filter value not found: %s\n", input); in attr_enum_filter()
141 pr_err("kunit executor: invalid filter input: %s\n", input); in attr_enum_filter()
145 return int_filter(test_val, input, input_int, err); in attr_enum_filter()
148 static int attr_speed_filter(void *attr, const char *input, int *err) in attr_speed_filter() argument
150 return attr_enum_filter(attr, input, err, speed_str_list, KUNIT_SPEED_MAX); in attr_speed_filter()
157 static int attr_string_filter(void *attr, const char *input, int *err) in attr_string_filter() argument
161 if (!strncmp(input, "<", 1)) { in attr_string_filter()
163 pr_err("kunit executor: invalid filter input: %s\n", input); in attr_string_filter()
165 } else if (!strncmp(input, ">", 1)) { in attr_string_filter()
167 pr_err("kunit executor: invalid filter input: %s\n", input); in attr_string_filter()
169 } else if (!strncmp(input, "!=", 2)) { in attr_string_filter()
170 return (strcmp(input + 2, str) != 0); in attr_string_filter()
171 } else if (!strncmp(input, "=", 1)) { in attr_string_filter()
172 return (strcmp(input + 1, str) == 0); in attr_string_filter()
175 pr_err("kunit executor: invalid filter operation: %s\n", input); in attr_string_filter()
179 static int attr_bool_filter(void *attr, const char *input, int *err) in attr_bool_filter() argument
185 for (i = 0; input[i]; i++) { in attr_bool_filter()
186 if (!strchr(op_list, input[i])) { in attr_bool_filter()
187 input_str = input + i; in attr_bool_filter()
194 pr_err("kunit executor: filter value not found: %s\n", input); in attr_bool_filter()
204 pr_err("kunit executor: invalid filter input: %s\n", input); in attr_bool_filter()
208 return int_filter(val, input, input_int, err); in attr_bool_filter()
320 int kunit_get_filter_count(char *input) in kunit_get_filter_count() argument
324 for (i = 0; input[i]; i++) { in kunit_get_filter_count()
325 if (input[i] == ',') { in kunit_get_filter_count()
342 char *input = *filters; in kunit_next_attr_filter() local
345 for (i = 0; input[i]; i++) { in kunit_next_attr_filter()
346 if (op_index < 0 && strchr(op_list, input[i])) { in kunit_next_attr_filter()
348 } else if (!comma_index && input[i] == ',') { in kunit_next_attr_filter()
350 } else if (comma_index && input[i] != ' ') { in kunit_next_attr_filter()
358 pr_err("kunit executor: filter operation not found: %s\n", input); in kunit_next_attr_filter()
363 op = input[op_index]; in kunit_next_attr_filter()
364 input[op_index] = '\0'; in kunit_next_attr_filter()
368 if (!strcmp(input, kunit_attr_list[j].name)) { in kunit_next_attr_filter()
374 input[op_index] = op; in kunit_next_attr_filter()
378 pr_err("kunit executor: attribute not found: %s\n", input); in kunit_next_attr_filter()
384 input[comma_index] = '\0'; in kunit_next_attr_filter()
385 filter.input = input + op_index; in kunit_next_attr_filter()
386 input = input + new_start_index; in kunit_next_attr_filter()
388 filter.input = input + op_index; in kunit_next_attr_filter()
389 input = NULL; in kunit_next_attr_filter()
392 *filters = input; in kunit_next_attr_filter()
422 default_result = filter.attr->filter(filter.attr->attr_default, filter.input, err); in kunit_filter_attr_tests()
428 suite_result = filter.attr->filter(suite_val, filter.input, err); in kunit_filter_attr_tests()
436 filter.input, err); in kunit_filter_attr_tests()