static struct sdca_entity *find_sdca_entity_by_label(struct sdca_function_data *function,
const char *entity_label)
{
+ struct sdca_entity *entity = NULL;
int i;
for (i = 0; i < function->num_entities; i++) {
- struct sdca_entity *entity = &function->entities[i];
+ entity = &function->entities[i];
+
+ /* check whole string first*/
+ if (!strcmp(entity->label, entity_label))
+ return entity;
+ }
+
+ for (i = 0; i < function->num_entities; i++) {
+ entity = &function->entities[i];
if (!strncmp(entity->label, entity_label, strlen(entity_label)))
return entity;