Lines Matching +full:- +full:- +full:count
1 // SPDX-License-Identifier: BSD-2-Clause
3 * Copyright (c) 2017-2020, Linaro Limited
33 size_t buf_len = sizeof(struct obj_attrs) + (*head)->attrs_size; in add_attribute()
54 (*head)->attrs_size += 2 * sizeof(uint32_t) + size; in add_attribute()
55 (*head)->attrs_count++; in add_attribute()
70 end = cur + h->attrs_size; in _remove_attribute()
83 TEE_MemMove(cur, cur + next_off, end - (cur + next_off)); in _remove_attribute()
85 h->attrs_count--; in _remove_attribute()
86 h->attrs_size -= next_off; in _remove_attribute()
87 end -= next_off; in _remove_attribute()
104 void **attr, uint32_t *attr_size, size_t *count) in get_attribute_ptrs() argument
107 char *end = cur + head->attrs_size; in get_attribute_ptrs()
109 size_t max_found = *count; in get_attribute_ptrs()
127 continue; /* only count matching attributes */ in get_attribute_ptrs()
149 *count = found; in get_attribute_ptrs()
155 size_t count = 1; in get_attribute_ptr() local
157 get_attribute_ptrs(head, attribute, attr_ptr, attr_size, &count); in get_attribute_ptr()
159 if (!count) in get_attribute_ptr()
162 if (count != 1) in get_attribute_ptr()
181 /* This reuses buffer-to-small for any bad size matching */ in get_attribute()
210 char *end = cur + head->attrs_size; in modify_attributes_list()
223 cli_head.size ? cli_ref->data : NULL, in modify_attributes_list()
250 size_t count = ref->attrs_count; in attributes_match_reference() local
251 unsigned char *ref_attr = ref->attrs; in attributes_match_reference()
254 if (!ref->attrs_count) { in attributes_match_reference()
259 for (count = 0; count < ref->attrs_count; count++) { in attributes_match_reference()
285 size_t count = ref->attrs_count; in attributes_match_add_reference() local
286 unsigned char *ref_attr = ref->attrs; in attributes_match_add_reference()
289 if (!ref->attrs_count) in attributes_match_add_reference()
292 for (count = 0; count < ref->attrs_count; count++) { in attributes_match_add_reference()
323 #define ATTR_TRACE_FMT "%s attr %s / %s\t(0x%04"PRIx32" %"PRIu32"-byte"
448 IMSG_RAW("%s,--- (serial object) Attributes list --------", pre); in trace_attributes()
449 IMSG_RAW("%s| %"PRIu32" item(s) - %"PRIu32" bytes", in trace_attributes()
456 IMSG_RAW("%s`-----------------------", prefix ? prefix : ""); in trace_attributes()